System.Net.Mail Alternative

Viewed 7495

I'm working on a tool that schedules emails with our mail server in C#. I had been using the System.Net.Mail classes to send the mail.

Recently I've come across various issues with regards to RFC violations and other issues, such as SmtpClient not ending the SMTP session according to protocol. Each of these problems is counting toward a high spam score and affecting email delivery, so I need a solution to these problems.

I'm wondering what other people have resorted to in order to resolve these issues. Have people started using a third part component, if so which one?

EDIT: As supporting evidence, please see: http://www.codeproject.com/KB/IP/MailMergeLib.aspx

8 Answers

SmtpClient was modified in .NET 4.0 so that it properly closes connections by sending a QUIT message. In addition, significant improvements were made to standards compliance with respect to unicode encoding and folding of long line lengths so you should find that your spam scores go down if you switch to .NET 4.0. The folding and encoding fixes shipped in .NET 4.0 Beta 2 but you'll have to wait until .NET 4.0 RC to get the QUIT message fix. In addition, SmtpClient will now implement IDisposable so that you can deterministically close your smtp connections when you are finished sending messages. This blog post details some of the improvements that have been made although it doesn't talk about IDisposable on SmtpClient (should be another blog post on that blog at some point that describes that change): http://blogs.msdn.com/ncl/archive/2009/08/06/what-s-new-in-system-net-mail.aspx

Related