Open svoop opened 5 years ago
well, that's because mailhog uses simple smtp.SendMail
(https://github.com/mailhog/MailHog-Server/blob/master/api/v1.go#L335) function which is hard coded to use localhost
(https://golang.org/src/net/smtp/smtp.go#L69).
the only option is to create a smtp client and call Hello
method with desired host (https://golang.org/src/net/smtp/smtp.go#L91).
This is from the MailHog
-help
:Start MailHog as follows:
Then release a mail, my recipient SMTP server logs:
Apparently, the
-hostname
is only used for MAIL FROM (which is good) and not for HELO/ELHO (which kills the release feature on many SMTP hosts).