共用方式為


MailBindingBase.Transport Property

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Gets or sets the transport that will be used by the input and output channels to receive and send messages.

Namespace:  Microsoft.ServiceModel.Channels.Mail
Assembly:  Microsoft.ServiceModel.Channels.Mail (in Microsoft.ServiceModel.Channels.Mail.dll)

Syntax

'Declaration
Public Property Transport As MailTransport
    Get
    Set
'Usage
Dim instance As MailBindingBase
Dim value As MailTransport

value = instance.Transport

instance.Transport = value
public MailTransport Transport { get; set; }
public:
property MailTransport^ Transport {
    MailTransport^ get ();
    void set (MailTransport^ value);
}
member Transport : MailTransport with get, set

Property Value

Type: Microsoft.ServiceModel.Channels.Mail.MailTransport
An object that represents the transport.

Remarks

The MailTransport class manages the communication channel for each mail endpoint.

The mail transport must be disposed when you close the application.

You have to set the mail transport if you are using one mail transport for multiple bindings.

Examples

The following example shows how to use the Transport property to dispose the mail transport.

' For a desktop application, use ExchangeWebServiceMailBinding.
binding = New WindowsMobileMailBinding()

binding.MinimumAttachmentSize = 1024
' Set lifetime to 1 day, 10 hours, 20 minutes, and 30 seconds.
binding.TimeToLive = New TimeSpan(1, 10, 20, 30)
binding.Transport.ReceiveRetryCount = 5
// For a desktop application, use ExchangeWebServiceMailBinding.
binding = new WindowsMobileMailBinding();

binding.MinimumAttachmentSize = 1024;
// Set lifetime to 1 day, 10 hours, 20 minutes, and 30 seconds.
binding.TimeToLive = new TimeSpan(1, 10, 20, 30);
binding.Transport.ReceiveRetryCount = 5;

.NET Framework Security

Platforms

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.

Version Information

.NET Compact Framework

Supported in: 3.5

See Also

Reference

MailBindingBase Class

MailBindingBase Members

Microsoft.ServiceModel.Channels.Mail Namespace