MailTransportBindingElementBase.TimeToLive Property
[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]
Gets or sets a structure that determines the lifetime of messages sent on the output channel that is created for this binding.
Namespace: Microsoft.ServiceModel.Channels.Mail
Assembly: Microsoft.ServiceModel.Channels.Mail (in Microsoft.ServiceModel.Channels.Mail.dll)
Syntax
'Declaration
Public Property TimeToLive As TimeSpan
Get
Set
'Usage
Dim instance As MailTransportBindingElementBase
Dim value As TimeSpan
value = instance.TimeToLive
instance.TimeToLive = value
public TimeSpan TimeToLive { get; set; }
public:
property TimeSpan TimeToLive {
TimeSpan get ();
void set (TimeSpan value);
}
member TimeToLive : TimeSpan with get, set
Property Value
Type: System.TimeSpan
The lifetime of the message.
Exceptions
Exception | Condition |
---|---|
ArgumentOutOfRangeException | TimeToLive is less than TimeSpan.Zero. |
Remarks
This property determines the lifetime of the message, which is the time elapsed since the message was created by the output channel. If the destination transport receives the message after the lifetime has elapsed, the message is deleted and is not sent to the application.
Examples
The following example shows how to use the TimeToLive property. It uses a TimeSpan constructor that enables you to specify the lifetime of the message in days, hours, minutes, and seconds.
mailTransportBindingElement = New WindowsMobileMailTransportBindingElement()
mailTransportBindingElement.MessageContainerType = MessageContainerType.Attachment
' In this example, set lifetime to 1 day, 10 hours,
' 20 minutes, and 30 seconds.
mailTransportBindingElement.TimeToLive = New TimeSpan(1, 10, 20, 30)
mailTransportBindingElement = new WindowsMobileMailTransportBindingElement();
mailTransportBindingElement.MessageContainerType = MessageContainerType.Attachment;
// In this example, set lifetime to 1 day, 10 hours,
// 20 minutes, and 30 seconds.
mailTransportBindingElement.TimeToLive = new TimeSpan(1, 10, 20, 30);
.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
See Also
Reference
MailTransportBindingElementBase Class