The text of the text/plain body part, of a mult-part mime formatted email.
This text will be shown to those mail readers that do not support html formatted emails. This property will retrieve or set the text body of a multi-part email. This property achieves the same functionality as creating a MimeBodyPart, setting it’s BodyFormat= MailFormat.Text, and adding the part using AddMimeBodyPart(). If TextBodyPart is set to null, the Text body part will be removed from the collection.
EmailMessage msg = new EmailMessage();
msg.Server = "Mail1.MyCompany.com";
msg.FromAddress = "me@MyCompany.com";
msg.To = "you@YourCompany.com";
msg.Subject = "Daily Newsletter";
msg.TextBodyPart = "Here is our daily newsletter.....";
if ( msg.Send() )
{
Console.WriteLine( "Message Sent!");
}
else
{
Console.WriteLine( msg.LastException().Message );
}
Dim msg As New EmailMessage()
msg.Server = "Mail1.MyCompany.com"
msg.FromAddress = "me@MyCompany.com"
msg.To = "you@YourCompany.com"
msg.Subject = "Daily Newsletter"
msg.TextBodyPart = "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 | MimeBodyPart