Setting connection timeout

Top  Previous  Next

You can use the Smtp#setTimeout method to define the maximum number of milliseconds to wait when establishing a connection to an SMTP server. Failure to establish a connection within the maximum time allowed will result in an SmtpException.

 

Example

 

// set connection timeout to 5 seconds

smtp.setTimeout(5000);

smtp.connect();





Home | Company | Products | Solutions | Purchase | Support | Services | Blog

© 2021 JSCAPE LLC