go-gomail / gomail

The best way to send emails in Go.
MIT License
4.32k stars 572 forks source link

Need Help: How can I keep the connection alive instead of Dialling everytime?. #96

Closed astromahi closed 6 years ago

astromahi commented 7 years ago

Can we handle the dial object like database handle so that I don't have to dial each time I send email?.

jordan-wright commented 6 years ago

Use Dial to get a SendCloser and then use that SendCloser when you call Send.

You can see an example (check out the "Newsletter" example) here: https://godoc.org/gopkg.in/gomail.v2#ex-package--Newsletter

astromahi commented 6 years ago

Thank you Jordan.