Search code examples
emailvbscriptbulk

Bulk email using VBS


I have a need to bulk email using VBS, but cannot test anything more than a few emails, and hence, do not get a good account for the speed of operation.

I have several plain text files containing email addresses for different groups of people.

I am using Set objMessage = CreateObject("CDO.Message") as the mechanism to send.

My query is which of the following will be the quickest to process, and therefore take least amount of time to complete:

  1. Do a loop to read all the email addresses one by one and add to objMessage.Bcc variable using the following: For Each line In listLines bccline = bccline + line + ";" Next objMessage.Bcc = bccline

  2. Do a loop to read one email address, send email, and so on until end of text file.

I have coded both ways and both work great, but as stated, I have no way of really finding out what is the quickest.

I would appreciate any feedback/suggestions on this.

Regards.


Solution

  • Option #1 will definitely be faster. Each time you executed the send email command, the program will need to pass the complete data to the mail server/service to process. The lesser time you executing the send command, the faster the entire program will complete.