• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 886
  • Last Modified:

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


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.Delimiter = ";"
objMailer.Recipient = strRecipients
objMailer.CcRecipient = strCC
objMailer.BccRecipient = strBCC
objMailer.Attachment = strAttachments
objMailer.MaxRecipients = 4000
objMailer.UseAuthentication = True
objMailer.UserName = strEmailAcct
objMailer.Password = strEmailAcctPwd
Select Case objMailer.Connect
    Case False
       'Return an error
       SendAnEmail = False
    Case True
       'Return a success-message
        SendAnEmail = True
End Select
Set objMailer = Nothing

Exit Function

    MsgBox "Message from SendAnEmail_EH" & vbCrLf & vbCrLf & "Unable to send an email." & vbCrLf & vbCrLf & "Error " & Err.Number & ". " & Err.Description, vbExclamation, strContactMaria
End Function
  • 3
  • 2
1 Solution
Shanmuga SundaramDirector of Software EngineeringCommented:
Very simple. The code that you had posted will get the emailaddress, message, subject and attachment from the user and will send it to the specified mail address. if it is not successful then  it will display the error mentioned in the msgbox. if it is success then it will not display any message. They have used one function to perform this task. this comes after the block that I copied and pasted below.

If SendAnEmail (strUserEmail, "", "", Trim(txtSubject.Text), Trim(txtMessage.Text), strAttachments, strMSOutlookEmail, strMSOutlook, strMSOutlookEmailPwd) = False Then
     MsgBox "Email failed", vbexclamation, "Attention"
End If

MariaHaltAuthor Commented:
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.  
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

MariaHaltAuthor Commented:
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!
I wouldn't think there would be much extra load than Outlook.  Since both Outlook and your app make calls to the SMTP server, it shouldn't make much of a difference.  
Here's a test the admin can run:
Start Oulook, create a new message, add 50 recipients, send.  
Start your app, create a new message, add 50 recipients, send.  
Monitor the server during both sends to see how each affects the server.  
MariaHaltAuthor Commented:
That's a good idea...thanks.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now