jordan-wright / email

Robust and flexible email library for Go
MIT License
2.61k stars 324 forks source link

Enable customization of localName for clients #127

Open jexh opened 3 years ago

jexh commented 3 years ago

This change enables custom LocalName entries to be specified for sending emails.

The motive is that smtp-relay.gmail.com heavily throttles the number of emails that are accepted with a LocalName of "localhost". To get past the ehlo step in this case the connection must specify another LocalName.

The smtp library has "localhost" hardcoded, so this change also changes the Send(...) implementation to inline the smtp.SendMail(...) call, modifying the Hello step.