On Sun, Aug 27, 2017 at 10:31 PM, <yhj772...@163.com> wrote:

>
> Without setting timeout on sending, it spent 5 minutes to send an email.
> Badly, it will hang up, then cause bug on production.
>

That means the mail server is busy. Setting shorter timeout will
stress mail server even more and make things worse for everyone.

The proper way is wait, and retry (dialing), with each retry waiting twice
as long as before. So even if the remote mail server is down for a few
hours, you email can still go through eventually.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to