MailBee.NET Objects 4.0

TextBodyPart.TransferEncoding Property

Gets or sets the mail transfer encoding of the text part contents.

public MailTransferEncoding TransferEncoding {get; set;}

Property Value

The mail transfer encoding of the text part contents. The default value for new messages is QuotedPrintable.

Remarks

When parsing existing messages, the mail transfer encoding is taken from Content-Transfer-Encoding header. If the text part does not contain this header, the value will be None. However, MailBee always decodes messages automatically so this property is just for information purposes only.

When composing new messages, you use this property to set mail transfer encoding to non-QuotedPrintable value. However, this can be useful under special circumstances only. Anyway, to change mail transfer encoding of HTML or plain-text parts of the message, it's easier to use and properties of the MailMessage itself.

Example

This sample creates a new message with HTML body, sets the mail transfer encoding for the XML part to Base64, and saves it to disk. In real-world app, it would be a bit easier to use property to achieve the same effect.

[C#]
// To use the code below, import MailBee namespaces at the top of your code.
using MailBee;
using MailBee.Mime;

// The actual code (put it into a method of your class).
MailMessage msg = new MailMessage();
msg.BodyHtmlText = "<b>Hello</b>, <i>World</i>!";
msg.BodyParts.Html.TransferEncoding = MailTransferEncoding.Base64;
msg.SaveMessage(@"C:\Docs\TestMail.eml");
[Visual Basic]
' To use the code below, import MailBee namespaces at the top of your code.
Imports MailBee
Imports MailBee.Mime

' The actual code (put it into a method of your class).
Dim msg As New MailMessage
msg.BodyHtmlText = "<b>Hello</b>, <i>World</i>!"
msg.BodyParts.Html.TransferEncoding = MailTransferEncoding.Base64
msg.SaveMessage("C:\Docs\TestMail.eml")

See Also

TextBodyPart Class | MailBee.Mime Namespace | MailTransferEncodingHtml | MailTransferEncodingPlain | MailTransferEncodingHtml | MailTransferEncodingPlain | MailTransferEncodingHtml