Results of my ASPEmail vs CDOSYS test - CDOSYS wins hands down!

antic

Perch
Thought I'd start a new thread for this, so everyone can see the results.

I have a client who needs to send emails to around 400 members each month. Not a great deal in the scheme of things, but I wanted to test the two methods - using ASPEmail or CDOSYS - to see which is better for the client and for the servers.

I started by using ASPEmail, and sending all of the ~400 emails initially caused a timeout! That is, it took more than 90 seconds (the default ASP process limit) to go though them. It got to send about 320 emails before timing out.

This can be overcome of course, by setting Server.ScriptTimeout to a big number, like 500. However, the longer a script runs, the worse for the servers, and also generally for user-friendliness.

Then I tried CDOSYS, which by default uses the server's own SMTP Server process to queue the emails before sending. I was impressed - it took 15 seconds to send all 400 emails. It makes sense, as it's queueing them to disk first, which doesn't take long, returning control to your web application while the SMTP server sends them in the background.

This is the code I used, which I'd recommend as the best method overall to send emails:
Code:
Dim myMail
Set myMail = CreateObject("CDO.Message")

' put the code below in your loop of recipients if required:
myMail.Subject = "subject goes here"
myMail.From = "sender name <[email protected]>"
myMail.To = "recipient name <[email protected]>"
myMail.HTMLBody = "message in html format"
myMail.Send

' Release the object.
Set myMail = nothing

Easy, and no need to set config properties at all.

Hope this helps anyone who needs to send emails with the most efficient method.
 
Thanks for the follow-up on this. Your initial theory was right on and it makes sense to me too.
 
It does make sense and It's good to see the hyposothis to be proved correct. Though how are you sending the emails? I usually send them in a loop if you're sending multiple emails and send a few emails at a time.
 
Back
Top