We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
If the SMTP server isn't available then isn't possible to close the pool connections because it hangs indefinitely on net.Dial
package main import ( "fmt" "net/smtp" "time" "github.com/jordan-wright/email" ) func main() { e := email.NewEmail() e.From = "Jordan Wright <[email protected]>" e.To = []string{"[email protected]"} e.Bcc = []string{"[email protected]"} e.Cc = []string{"[email protected]"} e.Subject = "Awesome Subject" e.Text = []byte("Text Body is, of course, supported!") e.HTML = []byte("<h1>Fancy HTML is supported, too!</h1>") p, err := email.NewPool("smtp.gmail.com:65535", 1, smtp.PlainAuth("", "[email protected]", "password123", "smtp.gmail.com")) if err != nil { panic(err) } err = p.Send(e, 1*time.Second) if err != nil { fmt.Println(err) } // hangs here because it never opened the connection p.Close() }
For example the above code never exits because it uses a port where the server isn't listening.
IMO, a custom Dialer should be accepted so one can configure various timeouts to prevent this scenario.
The text was updated successfully, but these errors were encountered:
The package go-simple-mail https://github.com/xhit/go-simple-mail resolves this issue.
Feel free to adapt the method used in go-simple-mail for connection timeout and send timeout for this package.
Sorry, something went wrong.
No branches or pull requests
If the SMTP server isn't available then isn't possible to close the pool connections because it hangs indefinitely on net.Dial
For example the above code never exits because it uses a port where the server isn't listening.
IMO, a custom Dialer should be accepted so one can configure various timeouts to prevent this scenario.
The text was updated successfully, but these errors were encountered: