The email message body contents.
Do not set the Body property and also set the TextBodyPart and HtmlBodyPart properties. The TextBodyPart and HtmlBodyPart properties are designed for MulitPart emails. The body property should never be set, if either the TextBodyPart or HtmlBodyPart properties are set.
[C#]
EmailMessage msg = new EmailMessage( "mail.MyCompany.com" );
msg.FromAddress = "me@MyCompany.com";
msg.To = "you@YourCompany.com";
msg.Subject = "Daily Newsletter";
msg.Body = "Here is our daily 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.Body = "Here is our daily newsletter....."
If (msg.Send()) Then
Console.WriteLine("Message Sent!")
Else
Console.WriteLine(msg.LastException().Message)
End If
EmailMessage Class | aspNetEmail Namespace | HtmlBodyPart | TextBodyPart | MimeBodyPart