go-gomail / gomail

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

Daemon Mode Reset Method #77

Open fjace05 opened 7 years ago

fjace05 commented 7 years ago

I have a project that utilizes gomail in Daemon mode. So my connection to the SMTP servers stay open while there are still messages to send. If a message errors out for some reason, there is currently no way to reset the channel (with SMTP RSET command) causing the following messages to error out as well since some fields have already been sent. I haven't looked in-depth, but adding Reset to your smtpClient interface SHOULD be enough to bring in that method from the built in smtp client. Then, if an error is detected in daemon mode, the channel could be reset before attempting process another message.