Is there an SmtpClient.Timeout with infinite value?

4

Is there any way to put SmtpClient.Timeout with the infinite value? If yes, how?

    
asked by anonymous 28.09.2016 / 16:01

1 answer

1

By "luck" can not. It does not make sense to do that. But if you want to do it wrong you can use the time int.MaxValue , it will take almost a month.

If you need this you may have another problem. If one sending email takes longer than 5 seconds, it is unlikely to occur.

This technique is inadequate. If you can not after a short period of time you should try again at another attempt, take action because you fail, at least logging in.

Another technique is to send asynchronously, so do not lock the computer in this task and you can go to the others. Any e-mail should be done like this. If the SmtpClient API was done today I would have encouraged that.

    
28.09.2016 / 16:08