C#
//using System.Net.Mail
try 
{
  using(MailMessage mm = new MailMessage())
  {
    mm.IsBodyHtml = true;
    mm.From = new MailAddress("mittente@domnio.it");
    mm.To.Add(new MailAddress("detinatario@dominio.it"));
    mm.Subject = "Test email HTML";
    mm.Body = "<div style='color:red'>Messaggio da <a href='http://www.sgart.it>Sgart</a></div>"; 
    mm.Attachments.Add(new Attachment("nomeFile.txt"));

    SmtpClient client = new SmtpClient();
    client.Send(mm);
  }
}
catch
{
  // se l'invio va in errore...
}
Potrebbe interessarti anche: