You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The keep-alive implementation is not safe. You need to make your program safe.
A suggestion is open a connection, and use a goroutine to send a NOOP command every X seconds to avoid disconnection from server.
Commands to SMTP server is one command at time by connection, so use the NOOP and send emails if you are sure the client is not used by another goroutine. You can reset the time for NOOP if you send an email.
Also. If you use the keep-alive implementation and you not send NOOP or emails in a short time, the server will disconnect you, and you need to reconnect again before send an email.
i do some test with keepalive,but got some wrong (smtp server with mailhog )
some links https://github.com/rongfengliang/golang-email-learning/blob/master/main.go#L15
The text was updated successfully, but these errors were encountered: