This documentation is archived and is not being maintained.

MailMessage.BodyEncoding Property

Gets or sets the encoding type of the body of the e-mail message.

[Visual Basic]
Public Property BodyEncoding As Encoding
[C#]
public Encoding BodyEncoding {get; set;}
[C++]
public: __property Encoding* get_BodyEncoding();
public: __property void set_BodyEncoding(Encoding*);
[JScript]
public function get BodyEncoding() : Encoding;
public function set BodyEncoding(Encoding);

Property Value

One of the Encoding values that indicates the encoding type of the body of the e-mail message.

Example

[Visual Basic] 
Dim MyMessage As MailMessage = New MailMessage()
MyMessage.BodyEncoding = Encoding.ASCII

[C#] 
MailMessage MyMessage = new MailMessage();
MyMessage.BodyEncoding = Encoding.ASCII;

[C++] 
MailMessage* MyMessage = new MailMessage();
MyMessage->BodyEncoding = Encoding::ASCII;

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 2000, Windows XP Professional, Windows Server 2003 family

See Also

MailMessage Class | MailMessage Members | System.Web.Mail Namespace

Show: