I've found it easiest to wrapper the System.Net.Mail library in a helper class, and then that has allowed me to simply include my EmailHelper class in any project that needs the ability to send out emails.
Here's my regurgitated Send() method in my EmailHelper. You can see that it is quite easy to use.
public bool Send() {
bool emailSent = false;
if (_to.Count > 0) {
MailMessage msg = new MailMessage();
SmtpClient mail = new SmtpClient("your.email.host");
msg.From = new MailAddress(_fromAddress, _fromName);
foreach (String to in _to) {
msg.To.Add(new MailAddress(to));
}
foreach (String cc in _cc) {
msg.CC.Add(new MailAddress(cc));
}
msg.Subject = _subject;
msg.Body = _body;
msg.IsBodyHtml = true;
mail.Send(msg);
emailSent = true;
}
return emailSent;
}
Note that the _fromAddress, _fromName, etc. are just private attributes of the EmailHelper class. The private attributes _to and _cc are both just lists of type string.