Zip Component, Email Component, Encryption Component ActiveX Control for Zip Compression .NET Components for ASP.NET
ActiveX and .NET Components for Zip Compression, Encryption, Email, XML, S/MIME, HTML Email, Character Encoding, Digital Certificates, FTP, and more ASP Email ActiveX Component

Index of Chilkat Blog Posts

May 22, 2006

Send Emails One at a Time, or in a Bundle?

Say I have 10 emails to send outbound to an SMTP server.

1) Do I use a for loop and send each mail one at a time
2) Do I create a bundle, add the 10 emails to that bundle using a loop and then send the bundle

Which is better in terms of performance?

#2 is better because it happens in a single SMTP session. However, the behavior of SMTP servers vary with respect to errors. I’ll explain: Some SMTP servers do MX lookups to try to validate email addresses. Others do not. For the SMTP servers that validate, if an error occurs some will abort the entire transaction (i.e. no emails will be sent) whereas others will not. The behavior of Chilkat is to continue sending the remainder of emails in the bundle even when errors occur. Of course, if the SMTP server forcibly closes the session/connection, the emails will not be sent. It is impossible (for Chilkat) to know whether some or none of the emails were sent because each SMTP server may behave differently. My advice is to sanity-check your recipient email addresses in each bundle and to send in smaller chunks. You might also test to see how your SMTP server behaves with invalid email addresses — does the entire bundle not get sent? You can then code appropriately for it.

Privacy Statement. Copyright 2000-2011 Chilkat Software, Inc. All rights reserved.
Send feedback to

Components for Microsoft Windows XP, 2000, 2003 Server, Vista, Windows 7, and Windows 95/98/NT4.