0 votes

I am checking the smtp.SendMessage method.

Could you please give me an example in code using ClientBase.ReceiveTimeout.

by
reshown by

1 Answer

0 votes

As I explained earlier this property isn't specific to SendMessage method. It configures the amount of time the underlying Socket will wait to receive data.

Here's the code:

using(Smtp smtp = new Smtp())
{
    smtp.ReceiveTimeout = TimeSpan.FromSeconds(20);

    smtp.Connect("smtp.server.com");  // or ConnectSSL for SSL
    smtp.UseBestLogin("user", "password");

    smtp.Noop();

    smtp.Close();   
}            
by (297k points)
...