aspNetEmail

EmailMessage.BodyFormat Property

The Format of the body, either HTML formatted or TEXT formatted.

public MailFormat BodyFormat {get; set;}

Remarks

Can be either MailFormat.Text for text formatted email or MailFormat.Html for HTML formatted email. By default, the body format is text formatted.

Example

[C#]
		EmailMessage msg = new EmailMessage( "mail.MyCompany.com" );
		msg.FromAddress = "me@MyCompany.com";
		msg.To = "you@YourCompany.com";
		msg.Subject = "Daily Newsletter";
		msg.BodyFormat = MailFormat.Html;
		msg.Body = "Here is our <b>daily</b> newsletter.....";
		if ( msg.Send() )
		{
			Console.WriteLine( "Message Sent!");
		}
		else
		{
			Console.WriteLine( msg.LastException().Message );
		}
		
[Visual Basic]
		Dim msg As New EmailMessage("mail.MyCompany.com")
		msg.FromAddress = "me@MyCompany.com"
		msg.To = "you@YourCompany.com"
		msg.Subject = "Daily Newsletter"
		msg.BodyFormat = MailFormat.Html
		msg.Body = "Here is our <b>daily</b> newsletter....."
		If (msg.Send()) Then
		    Console.WriteLine("Message Sent!")
		Else
		    Console.WriteLine(msg.LastException().Message)
		End If
		

See Also

EmailMessage Class | aspNetEmail Namespace