Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

MessageContainerType Enumeration

.NET Framework 3.5

Specifies how the message data is sent by the channel.

Namespace:  Microsoft.ServiceModel.Channels.Mail
Assembly:  Microsoft.ServiceModel.Channels.Mail (in Microsoft.ServiceModel.Channels.Mail.dll)
public enum MessageContainerType
Member nameDescription
Supported by the .NET Compact FrameworkDefaultThe MinimumAttachmentSize property is used to determine whether the message will be sent in the e-mail message body or as an attachment. This is the default value.
Supported by the .NET Compact FrameworkBodyThe message is sent in the e-mail message body regardless of the message size.
Supported by the .NET Compact FrameworkAttachmentThe message is sent as an e-mail attachment regardless of the message size.

When the encoding element is TextMessageEncodingBindingElement, all enumeration members are supported. However, custom encoders must use the Attachment member.

It is typically more efficient to download larger messages as attachments, and download smaller messages in the message body. For the most precise control over how the message is sent, use the Default member and set the MinimumAttachmentSize property.

The following example shows how to use the MessageContainerType enumeration.

// Instantiate a TextMessageEncodingBindingElement or 
// a custom encoding binding element. If you use a custom encoding 
// binding element, messages must be sent as attachments.
msgEncodingBindingElement = new CustomMessageEncodingBindingElement();
mailTransportBindingElement = new WindowsMobileMailTransportBindingElement();

mailTransportBindingElement.MessageContainerType = MessageContainerType.Attachment;

Windows CE, Windows Mobile for Smartphone, Windows Mobile for Pocket PC

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Compact Framework

Supported in: 3.5
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.