Skip Navigation LinksHome : Submit Snippet : Snippet Search : Snippet Detail
Snippet language icon

Author:
Tim Heuer

Submitted:
06 Sep 2005

Language:
C#

Microsoft Employee

Microsoft MVP



Snippet Detail and Download

Snippet Type(s):  Expansion
Abstract (from author):
A simple snippet to create a mail message and SMTP client using the System.Net.Mail class libraries. This is a simple starter shell to emit the most basic properties.


Description (from snippet):
Simple snippet for using the System.Net SMTP mail components to send a simple mail message.


Code Block:
1 // build the mail message 2 MailMessage msg = new MailMessage(); 3 msg.To = $msgTo$; 4 msg.From = $msgFrom$; 5 msg.Subject = $msgSubject$; 6 msg.Body = $msgBody$; 7 msg.IsBodyHtml = false; 8 9 // build the smtp client 10 SmtpClient smtp = new SmtpClient(); 11 smtp.Host = $smtpHost$; 12 smtp.Send(msg);
Download Now!
Download the snippet file by clicking the download button below. You may customize the snippet shortcut prior to downloading below.

Shortcut:

The download is in Visual Studio Community Content Installer (VSI) format.