I have been playing around with Transaction Email Services for a while and came across the tool named MadMimi, A email marketing tool lets you to send email from a different server so that you can track whether the email delivered or bounce.
MadMimi already have a C# version API and its quite old. The reason I wrote my own version is to prevent less code change to my current project so that if I want to switch to a different provider in the feature it would be easy.
A typical email sending code
using (var message = new MailMessage()) { message.To.Add("receiver"); message.From = new MailAddress("from"); message.Subject = "Subject"; message.Body = "This is test"; using (var client = new SmtpClient()) { client.Send(message); } }
Using Library
var mailer = new Mailer("username", "apikey"); using (var message = new MailMessage()) { message.From = new MailAddress("from email", "display name"); message.To.Add("sender email"); message.Subject = "Test"; message.Body = "Email body"; await mailer.SendAsync("Promotion Name", message); } var status = mailer.TrackStatus; //URL to track the email var mailTransactionId = mailer.TransactionId; //Transaction Id.
When you compare the above code snippets you should see additional two liner code which integrate the library (Mailer class) and that is the only change you should make your existing project and apps if you would like to integrate this.
Pros
SPF (Sender Policy Framework) – MadMimi does not care if you have set up a SPF record in DNS. While most of the competitors, this is a mandatory requirement if you want to use your own “FROM” email address other than your DOMAIN.
Cons
1) Delivery speed – Some time the email take 5-6 minutes to deliver.
2) No SMTP relay support.
3) Attachment does not support via API.
Feel free to play around and fork it if you would like to make any change to this. The GitHub link is provided below for the sample project and library.
Repository – https://github.com/deepumi/MadMimi.Net