<<Back To Faq 3.1.1

Complete FAQ Listing

3.1.1 How do I send a plain text email? Printer Friendly

The following example demonstrates sending a simple plain text email.
[ C# ]
//create the mail message
MailMessage mail = new MailMessage();

//set the addresses
mail.From = new MailAddress("me@mycompany.com");

//set the content
mail.Subject = "This is an email";
mail.Body = "this is a sample body";

//send the message
SmtpClient smtp = new SmtpClient("");

[ VB.NET ]
 'create the mail message
Dim mail As New MailMessage()

'set the addresses
mail.From = New MailAddress("me@mycompany.com")

'set the content
mail.Subject = "This is an email"
mail.Body = "this is a sample body"

'send the message
Dim smtp As New SmtpClient("")


The formatted version of this faq can be found at http://www.SystemNetMail.com/faq/3.1.1.aspx