0
votes

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.

2

2 Answers

0
votes

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.

0
votes

Option 1 would be optimal in terms of rapid delivery because you're sending One message to a MTA and the MTA handles delivery to the rest.

Another option

For example if you needed a specially tailored message for specific individuals or groups of individuals based on the text file you need, the fastest way to send those out is to spawn multiple threads using shell execute w/o waiting to start the next one.. is firing off an email script with arguments or named arguments.

Named arguments are something like this: /to:[email protected]. The tricky part of using that is avoiding characters that make CMD cranky. So build in a function to escape characters that might cause CMD to interpret characters differently... I'm all for scale so this is the method I might use. But if it's just a general broadcast - BCC is your best option.