MailBindingBase.Transport Property
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
'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);
}
public function get Transport () : MailTransport
public function set Transport (value : MailTransport)
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
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
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