System.Net.Mail.MailMessage.AlternateViews Property

Gets the attachment collection used to store alternate forms of the message body.


public AlternateViewCollection AlternateViews { get; }


Documentation for this section has not yet been entered.


Use the MailMessage.AlternateViews property to specify copies of an e-mail message in different formats. For example, if you send a message in HTML, you might also want to provide a plain text version in case some of the recipients use e-mail readers that cannot display HTML content.

To add an alternate view to a System.Net.Mail.MailMessage object, create an System.Net.Mail.Attachment for the view, and then add it to the collection returned by MailMessage.AlternateViews. Use the MailMessage.Body property to specify the text version and use the MailMessage.AlternateViews collection to specify views with other MIME types. Use the System.Net.Mime.MediaTypeNames class members to specify the MIME type for the alternate view.


Namespace: System.Net.Mail
Assembly: System (in System.dll)
Assembly Versions:,
Since: .NET 2.0