共用方式為


MessageContainerType 列舉型別

指定通道如何傳送訊息資料。

命名空間:  Microsoft.ServiceModel.Channels.Mail
組件:  Microsoft.ServiceModel.Channels.Mail (在 Microsoft.ServiceModel.Channels.Mail.dll 中)

語法

'宣告
Public Enumeration MessageContainerType
'用途
Dim instance As MessageContainerType
public enum MessageContainerType
public enum class MessageContainerType
public enum MessageContainerType

成員

成員名稱 說明
Bb350956.CFW(zh-tw,VS.90).gif Default MinimumAttachmentSize 屬性可用來決定要以電子郵件訊息主體或以電子郵件附件傳送訊息。這是預設值。
Bb350956.CFW(zh-tw,VS.90).gif Body 無論訊息大小為何,都會以電子郵件訊息主體來傳送訊息。
Bb350956.CFW(zh-tw,VS.90).gif Attachment 無論訊息大小為何,都會以電子郵件附件來傳送訊息。

備註

當編碼項目為 TextMessageEncodingBindingElement 時,可支援所有的列舉型別 (Enumeration) 成員。不過,自訂編碼器必須使用 Attachment 成員。

使用附件下載大型訊息並使用訊息主體下載小型訊息通常是較有效率的做法。若要更精確地控制訊息的傳送方式,請使用 Default 成員並設定 MinimumAttachmentSize 屬性。

範例

在下列範例中,示範了如何使用 MessageContainerType 列舉型別。

' 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
// 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

.NET Framework 和 .NET Compact Framework 並不支援各種平台的所有版本。如需支援平台版本的相關資訊,請參閱 .NET Framework 系統需求

版本資訊

.NET Compact Framework

支援版本:3.5

請參閱

參考

Microsoft.ServiceModel.Channels.Mail 命名空間