Setting E-Mail Encodings for the E-Mail Body and Attachments


E-mail encoding is used to pass information from the sender to the recipient using a desired format. Typically ASCII encoding is used for all e- mails , but in case an alternative format is needed, the BodyEncoding property is available to change the encoding type. The Encoding object contains four enumerations of encoding. Different encoding schemes might be necessary for both older legacy systems, and when Unicode support for international characters is needed. Table 15.3 describes each of these.

Table 15.3. E-Mail Encoding Types

Encoding Type



Encodes characters as single 7-bit ASCII characters.


Encodes characters as two consecutive bytes. Little-endian (code page 1200) and Big-endian (code page 1201) byte orders are supported.


UCS Transformation Format (UTF), 7-bit form. Can also be accessed as code page 65000.


UCS Transformation Format (UTF), 8-bit form. Can also be accessed as code page 65001.

To apply the encoding to the e-mail message body, the following syntax can be used:

 mailObj.BodyEncoding = Encoding.ASCII 

Special Edition Using ASP. NET
Special Edition Using ASP.Net
ISBN: 0789725606
EAN: 2147483647
Year: 2002
Pages: 233 © 2008-2017.
If you may any questions please contact us: