PowerTCP Mail for .NET
Timeout Property
See Also  Send comments on this topic.
Dart.PowerTCP.Mail Namespace > Smtp Class : Timeout Property




Specifies the maximum number of milliseconds to wait for responses to commands or time between data buffer transfers.

Syntax

Visual Basic (Declaration) 
<DescriptionAttribute("The number of milliseconds that this should wait for an operation to complete before returning a timeout error, if at all.")>
<DefaultValueAttribute()>
<CategoryAttribute("Behavior")>
Public Property Timeout As Integer
Visual Basic (Usage)Copy Code
Dim instance As Smtp
Dim value As Integer
 
instance.Timeout = value
 
value = instance.Timeout
C# 
[DescriptionAttribute("The number of milliseconds that this should wait for an operation to complete before returning a timeout error, if at all.")]
[DefaultValueAttribute()]
[CategoryAttribute("Behavior")]
public int Timeout {get; set;}
Managed Extensions for C++ 
[DescriptionAttribute("The number of milliseconds that this should wait for an operation to complete before returning a timeout error, if at all.")]
[DefaultValueAttribute()]
[CategoryAttribute("Behavior")]
public: __property int get_Timeout();
public: __property void set_Timeout( 
   int value
);
C++/CLI 
[DescriptionAttribute("The number of milliseconds that this should wait for an operation to complete before returning a timeout error, if at all.")]
[DefaultValueAttribute()]
[CategoryAttribute("Behavior")]
public:
property int Timeout {
   int get();
   void set (    int value);
}

Property Value

An integer specifying the maximum number of milliseconds to wait for responses to commands.

Example

The following example demonstrates properties of the Smtp component.
Visual BasicCopy Code
' Be sure to import the namespace by putting "Imports Dart.PowerTCP.Mail"
' at the top of your class.

' Don't ask the server if the message is too large.
Smtp1.AutoSize = False

' Only wait 10 seconds for a response
Smtp1.Timeout = 10000

' Send a message
Smtp1.Server = "mail.test.com"
Smtp1.Send("you@test.com", "me@test.com", "test", "test message"
C#Copy Code
// Be sure to import the namespace by putting "using Dart.PowerTCP.Mail;"
// at the top of your class.

// Don't ask the server if the message is too large.
smtp1.AutoSize = false;

// Only wait 10 seconds for a response
smtp1.Timeout = 10000;

// Send a message
smtp1.Server = "mail.test.com";
smtp1.Send("you@test.com", "me@test.com", "test", "test message");

Remarks

After connecting to a server, this value is used to establish the period of time to wait for server responses. During data transfer operations, a SocketException will be thrown if any data buffer transfer operation does not complete within the timeout period.

Requirements

Target Platforms: Microsoft .NET Framework 2.0

See Also

Documentation Version 3.2
© 2010 Dart Communications. All Rights Reserved.