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 = &tls.Config{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.