RSS Feed
Jan 16

Practical Programming: Sending Email

Posted on Friday, January 16, 2009 in Practical Programming

By Derek Hatchard

Derek_Hatchard Sending email from a .NET application is incredibly simple:

using System.Net.Mail;

SmtpClient _smtp = new SmtpClient("smtp.test.com");
_smtp.Send(""
           ""
           "Subject"
           "Body");

With just these few lines of code, you are sending an email from to . Pretty easy stuff.

But what if you need something a little more complicated? The example above assumes the standard SMTP port for email with no authentication and an unencrypted connection. Fortunately these “complications” are quite easy to deal with in .NET.

(more…)

`