Last post Sep 26, 2017 03:25 AM by Cathy Zou
Sep 25, 2017 03:35 PM|comicrage|LINK
I checked on google on this issue but have not found a solution so far. I am getting a "The operation has timed out".
I am testing and noticed that this exception is thrown on the 7th email or 50th email. At first, there was no specified timeout. So I set the client.Timeout to 20000 ms and later 30000, but the smtpclient still throws the exception.
client.Timeout = 30000; client.Send(message);
I tried setting client.port = 587 and client.EnableSsl = true, but I got a Failed to send mail.
It seems like the Timeout increased value did not work.
Any help is appreciated.
Sep 25, 2017 03:57 PM|PatriceSc|LINK
ex.ToString() could help to have the full story as well as the call stack. My first thought would be some kind of throttling on the Google side?
Maybe not directly related but 587 and SSL should definitively work (or could it be that you have a proxy in between that is blocking that and might be perhaps responsible for bandwidth throttling ?
Sep 26, 2017 03:25 AM|Cathy Zou|LINK
By default, calls to the Send method block until the operation completes. If you set the Timeout property to a positive value, and a Send operation cannot complete in the allotted time, the SmtpClient class throws an SmtpException exception.
To send a message and continue executing in the application thread, use the SendAsync method.
To receive notification when the e-mail has been sent or the operation has been canceled, add an event handler to the SendCompleted event.
Or you could try to change your client.port=465