aspNetEmail

EmailMessage.TimeOut Property

The timeout, in milliseconds, to talk to the mail server. By default this setting is 20,000 for 20 seconds.

public int TimeOut {get; set;}

Example

[C#]
		EmailMessage msg = new EmailMessage();
		msg.Server = "Mail1.MyCompany.com";
		msg.FromAddress = "me@MyCompany.com";
		msg.To = "you@YourCompany.com";
		msg.Subject = "Daily Newsletter";
		msg.Body = "Here is our daily newsletter.....";
		msg.TimeOut = 30000;
		if ( msg.Send() )
		{
			Console.WriteLine( "Message Sent!");
		}
		else
		{
			Console.WriteLine( msg.LastException().Message );
		}
		
[Visual Basic]
		Dim msg As New EmailMessage()
		msg.Server = "Mail1.MyCompany.com"
		msg.FromAddress = "me@MyCompany.com"
		msg.To = "you@YourCompany.com"
		msg.Subject = "Daily Newsletter"
		msg.Body = "Here is our daily newsletter....."
		msg.TimeOut = 30000
		If (msg.Send()) Then
		    Console.WriteLine("Message Sent!")
		Else
		    Console.WriteLine(msg.LastException().Message)
		End If
		

See Also

EmailMessage Class | aspNetEmail Namespace