Improving the Send email class from ASP.NET

A few years ago I wrote a component to send emails faster, track them and load balance them between mail servers.

The component has this features for sending emails:

  • Allows you to add a list of mail servers that will use to load balance the emails
  • If the email fails to be send, won't give you an exception, will keep trying for 24 hours on different servers on the cluster.
  • If a mail server does not work, will remove it from the list.
  • When the user opens the email, you'll get a callback on the page you specify.

This is a sample of how to use the component:

// Create an array of all mail servers, mail server clusters and IPs you want to use
ArrayList aList = new ArrayList();
// Use it the same way than MailMessage
FreeMail.BetterMailMessage oMessage = new FreeMail.BetterMailMessage();
oMessage.DeliveryNotificationOptions = DeliveryNotificationOptions.OnFailure; oMessage.IsBodyHtml = false;
oMessage.Priority = MailPriority.High;
oMessage.Subject = "This is the subject";
oMessage.Body = TextBox2.Text;
MailAddress oFrom = new MailAddress("","Your Name");
oMessage.From = oFrom;
// This is the main class, you can set Load Balancing
// Tracking Url to call back when the user opens the email
// You can use SSL or Smtp Authentication like SmtpClient class
FreeMail.FreeMail oMail = new FreeMail.FreeMail(aList); 
oMail.LoadBalancing = true;
oMail.TrackingUrl = "";

Download the sample here

Download the component DLL 



Published Sunday, January 27, 2008 11:35 PM by albertpascual
Filed under: , , ,


# re: Improving the Send email class from ASP.NET

Monday, January 28, 2008 4:39 PM by Drew


This is a great tool.  Would you want to release the source code to CodePlex so others can learn from your work or even add to it.

Thanks for a great utility.

# re: Improving the Send email class from ASP.NET

Monday, January 28, 2008 7:55 PM by albertpascual

If anybody wants to add it into CodePlex they can go ahead and improve it, I just don't have the time to manage that ;-(

# re: Improving the Send email class from ASP.NET

Sunday, May 29, 2011 11:09 AM by

Improving the send email class from asp net.. Smashing :)