go-gomail / gomail

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

x509: certificate is valid for ..., not ... #120

Open BJBigler opened 6 years ago

BJBigler commented 6 years ago

Not sure what I'm doing wrong here. The emails send fine from localhost, but when I move the code to production, I get the error, "x509: certificate is valid for mywebhost.com, not smtp.smtphost.com". I'd sure appreciate any advice or direction.

crazy-canux commented 5 years ago

I got the same problem. I use python to test the smtp server, it's works. But with golang, it's not working. BTW, I don't have authentication for smtp server.

BJBigler commented 5 years ago

In my case, it wasn't the gomail package, but rather a server configuration issue as described here:

https://documentation.cpanel.net/display/68Docs/Tweak+Settings+-+Mail#TweakSettings-Mail-RestrictoutgoingSMTPtoroot,exim,andmailman(FKASMTPTweak)

pedromorgan commented 5 years ago

see #104 and #108

ghost commented 4 years ago

it will only send the credentials if the connection is using TLS or is connected to localhost. Otherwise authentication will fail with an error, without sending the credentials.