Even with FastSender it appears that it only handles 1 SMTP account and 1 proxy at a time, rather than, for example, 300 accounts running on 300 different proxies simultaneously
Is there a workaround for that?
Originally Posted by: codeatdusk
Sure FastSender can handle the multiple SMTP accounts, it is designed for that.
But in our example code, it uses only one SMTP account.
See the following example codes, it demonstrates how to handle multiple SMTP accounts:
Option Explicit
Private WithEvents m_oFastSender As EASendMailObjLib.FastSender
Private oSmtp As EASendMailObjLib.Mail
Private Sub Command1_Click()
Dim recipientAddr(3) As String
Dim froms(3) As String
Dim servers(3) As String
Dim users(3) AS String
Dim passwords(3) As String
recipientAddr(0) = "test@adminsystem.com"
recipientAddr(1) = "test1@adminsystem.com"
recipientAddr(2) = "test2@adminsystem.com"
froms(0) = "from@adminsystem.com"
froms(1) = "from1@adminsystem.com"
froms(2) = "from2@adminsystem.com"
servers(0) = "smtp.adminsystem.com"
servers(1) = "smtp1.adminsystem.com"
servers(2) = "smtp2.adminsystem.com"
users(0) = "from@adminsystem.com"
users(1) = "from1@adminsystem.com"
users(2) = "from2@adminsystem.com"
passwords(0) = "password"
passwords(1) = "password1"
passwords(2) = "password2"
Dim i As Integer
If m_oFastSender Is Nothing Or oSmtp Is Nothing Then
Set m_oFastSender = New EASendMailObjLib.FastSender
Set oSmtp = New EASendMailObjLib.Mail
oSmtp.LicenseCode = "TryIt"
' Set the maximum no. of worker threads
m_oFastSender.MaxThreads = 10
End If
For i = 0 To 2
' Your sender email address
oSmtp.FromAddr = froms(i)
' Your SMTP server address
oSmtp.ServerAddr = servers(i)
' User and password for ESMTP authentication, if your server doesn't require
' User authentication, please remove the following codes.
oSmtp.UserName = users(i)
oSmtp.Password = passwords(i)
' If your smtp server requires SSL connection, please add this line
' oSmtp.SSL_init
oSmtp.ClearRecipient
oSmtp.AddRecipientEx recipientAddr(i), 0
oSmtp.Subject = "mass email test subject"
oSmtp.BodyText = "mass email test body sent from vb"
Call m_oFastSender.Send( oSmtp, i, "any" )
Next
End Sub
Private Sub m_oFastSender_OnSent(ByVal lRet As Long, _
ByVal ErrDesc As String, _
ByVal nKey As Long, _
ByVal tParam As String, _
ByVal Sender As String, _
ByVal Recipients As String)
If lRet = 0 Then
MsgBox nKey & " email was sent successfully"
Else
MsgBox nKey & ": failed to send email: " & ErrDesc
End If
End Sub