Re: [go-nuts] Re: [ANN] Gomail v2: sending emails faster

2017-08-28 Thread yhj772709
Thanks very much.

But, what I mean of setting timeout is giving up this sending, and try to 
send another email


在 2017年8月29日星期二 UTC+8上午9:59:24,Antonio Sun写道:
>
>
>
> On Sun, Aug 27, 2017 at 10:31 PM,  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.


[go-nuts] Re: [ANN] Gomail v2: sending emails faster

2017-08-24 Thread yhj772709
Thank you very much for your reply. However, in my code, it spent 40s to 
send email. 

Here is the code:

now := time.Now()
msg := gomail.NewMessage()
//the element of msg is abridged
dial := gomail.Dialer{Host: "127.0.0.1", Port: 25}
dial.TLSConfig = {InsecureSkipVerify: true}
if err := dial.DialAndSend(msg); err != nil {
log.Fatal("failed to send email", err)
} else {
timeSpent := fmt.Sprintf("%.3f s", time.Since(now).Seconds())
fmt.Println("time to spend in sending email", timeSpent )
}

在 2017年8月25日星期五 UTC+8上午1:53:48,Tamás Gulácsi写道:
>
> It uses a constant 10s timeout for dial. What should time out?

-- 
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.


[go-nuts] Re: [ANN] Gomail v2: sending emails faster

2017-08-24 Thread yhj772709
Hi, 
Could you show me a method to set timeout when send a email?
Regards.

在 2015年9月2日星期三 UTC+8下午7:55:26,Alexandre Cesaro写道:
>
> Hi,
>
> I just released the second version of Gomail 
> .
>
> There are quite a few backward-incompatible changes 
>  since 
> Gomail v1 but it brings lots of good stuff:
>
>- A great focus was placed on performances. Gomail v2 is way more 
>efficient than Gomail v1 to send a large number of emails (see the 
>Daemon  
>or Newsletter 
> 
>examples).
>- The API is now clearer and way more flexible.
>- The documentation  improved 
>and many examples were added.
>- All existing issues have been closed.
>- The minimum Go version is now 1.2 instead of 1.3. No external 
>dependencies are used with Go 1.5.
>
> More info on Github: https://github.com/go-gomail/gomail
>

-- 
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.