Share via


MailTransport.ReceiveRetryCount Property

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

Gets or sets number of times the mail transport will try to receive and process invalid or malformed messages after the initial try.

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

Syntax

'Declaration
Public Property ReceiveRetryCount As Integer
    Get
    Set
'Usage
Dim instance As MailTransport
Dim value As Integer

value = instance.ReceiveRetryCount

instance.ReceiveRetryCount = value
public int ReceiveRetryCount { get; set; }
public:
property int ReceiveRetryCount {
    int get ();
    void set (int value);
}
member ReceiveRetryCount : int with get, set

Property Value

Type: System.Int32
The number of times the mail transport will try to receive invalid or malformed messages after the initial try. The default value is 3.

Exceptions

Exception Condition
ArgumentOutOfRangeException

The ReceiveRetryCount property is set to a value that is less than 0 (zero).

Remarks

The number of retries configured in this property does not include retries related to network errors or failed communications with Microsoft Exchange Server. ReceiveRetryCount determines the number of tries by the application to retrieve messages after they have arrived.

The mail transport will delete any invalid or malformed message after the last try to receive or process the message.

Any message that has a corrupted SOAP envelope is considered invalid. If the subject line in the message contains bad information after the store-and-forward stamp, such as an unsupported character in the channel name, it is considered a malformed message.

Examples

The following example shows how to use the ReceiveRetryCount property.

' 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

MailTransport Class

MailTransport Members

Microsoft.ServiceModel.Channels.Mail Namespace