MariaHalt
asked on
Using vbSendMail.dll to issue emails, the email admin what's to know how it works
This question is not about coding for vbSendMail but rather the question is: what is it really doing? Our email admin wants to know. To be honest, I don't care, the emails are being issued so I'm a happy programmer, however, the potential to issue thousands of emails is not sitting well with the email admin. She's concerned about traffic/load on the server. Can someone explain it to me in simple terms so that I can explain it to her?
Here is my code:
If SendAnEmail (strUserEmail, "", "", Trim(txtSubject.Text), Trim(txtMessage.Text), strAttachments, strMSOutlookEmail, strMSOutlook, strMSOutlookEmailPwd) = False Then
MsgBox "Email failed", vbexclamation, "Attention"
End If
Where:
Function SendAnEmail (ByVal strRecipients As String, ByVal strCC As String, ByVal strBCC As String, ByVal strSubject As String, ByVal strMessage As String, ByVal strAttachments As String, ByVal strFromEmail As String, ByVal strEmailAcct As String, ByVal strEmailAcctPwd As String) As Boolean
'To use this function, SMTP Send Mail for VB6.0 must be referenced!
Dim objMailer As New vbSendMail.clsSendMail
On Error GoTo SendAnEmail_EH
SendAnEmail = False
objMailer.Message = strMessage
objMailer.Subject = strSubject
objMailer.From = strFromEmail
objMailer.SMTPHost = "OUR MAIL SERVER NAME>"
objMailer.Delimiter = ";"
objMailer.Recipient = strRecipients
objMailer.CcRecipient = strCC
objMailer.BccRecipient = strBCC
objMailer.Attachment = strAttachments
objMailer.MaxRecipients = 4000
objMailer.UseAuthenticatio n = True
objMailer.UserName = strEmailAcct
objMailer.Password = strEmailAcctPwd
Select Case objMailer.Connect
Case False
'Return an error
SendAnEmail = False
Case True
objMailer.send
'Return a success-message
objMailer.Disconnect
SendAnEmail = True
End Select
Set objMailer = Nothing
Exit Function
SendAnEmail_EH:
MsgBox "Message from SendAnEmail_EH" & vbCrLf & vbCrLf & "Unable to send an email." & vbCrLf & vbCrLf & "Error " & Err.Number & ". " & Err.Description, vbExclamation, strContactMaria
End Function
Here is my code:
If SendAnEmail (strUserEmail, "", "", Trim(txtSubject.Text), Trim(txtMessage.Text), strAttachments, strMSOutlookEmail, strMSOutlook, strMSOutlookEmailPwd) = False Then
MsgBox "Email failed", vbexclamation, "Attention"
End If
Where:
Function SendAnEmail (ByVal strRecipients As String, ByVal strCC As String, ByVal strBCC As String, ByVal strSubject As String, ByVal strMessage As String, ByVal strAttachments As String, ByVal strFromEmail As String, ByVal strEmailAcct As String, ByVal strEmailAcctPwd As String) As Boolean
'To use this function, SMTP Send Mail for VB6.0 must be referenced!
Dim objMailer As New vbSendMail.clsSendMail
On Error GoTo SendAnEmail_EH
SendAnEmail = False
objMailer.Message = strMessage
objMailer.Subject = strSubject
objMailer.From = strFromEmail
objMailer.SMTPHost = "OUR MAIL SERVER NAME>"
objMailer.Delimiter = ";"
objMailer.Recipient = strRecipients
objMailer.CcRecipient = strCC
objMailer.BccRecipient = strBCC
objMailer.Attachment = strAttachments
objMailer.MaxRecipients = 4000
objMailer.UseAuthenticatio
objMailer.UserName = strEmailAcct
objMailer.Password = strEmailAcctPwd
Select Case objMailer.Connect
Case False
'Return an error
SendAnEmail = False
Case True
objMailer.send
'Return a success-message
objMailer.Disconnect
SendAnEmail = True
End Select
Set objMailer = Nothing
Exit Function
SendAnEmail_EH:
MsgBox "Message from SendAnEmail_EH" & vbCrLf & vbCrLf & "Unable to send an email." & vbCrLf & vbCrLf & "Error " & Err.Number & ". " & Err.Description, vbExclamation, strContactMaria
End Function
ASKER
I know what the code does, I wrote it. I just want to know what effect it has on the server.
From glancing at the source code for vbSendMail (http://www.freevbcode.com/ShowCode.Asp?ID=109) I believe it makes WinSock calls directly to the SMTP server.
I haven't looked at it too much but it is available.
I haven't looked at it too much but it is available.
ASKER
Now we're getting somewhere...please allow me to explain more. The VB app that's using the vbSendMail allows the user to issue emails quickly by custom selecting from a pool of students (with various options to filter for by course, instructor, citizenship, academic level, activities, etc...). The user can not do this in MSOutlook without selecting each student's name from the Global list (b/c it's very time consuming and user may not know the names of the students anyway and the enrollment changes constantly so setting up distribution lists are out of the question too).
The email admin is concerned about the load on the email server as opposed to using MSOutlook. Is the load greater or lesser? (There are no sent items recorded in the users MSOutlook folder so my guess is it is lesser). But I need to explain this to her in terms she can quantify.
Usually, I code stuff and if it works, I don't question how. But this time I need to explain the routing I guess. Please help!
The email admin is concerned about the load on the email server as opposed to using MSOutlook. Is the load greater or lesser? (There are no sent items recorded in the users MSOutlook folder so my guess is it is lesser). But I need to explain this to her in terms she can quantify.
Usually, I code stuff and if it works, I don't question how. But this time I need to explain the routing I guess. Please help!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
That's a good idea...thanks.
If SendAnEmail (strUserEmail, "", "", Trim(txtSubject.Text), Trim(txtMessage.Text), strAttachments, strMSOutlookEmail, strMSOutlook, strMSOutlookEmailPwd) = False Then
MsgBox "Email failed", vbexclamation, "Attention"
End If