This documentation is archived and is not being maintained.

MailBindingBase.Transport Property

Visual Studio 2008

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)

public MailTransport Transport { get; set; }

Property Value

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

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.

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;

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