Skip to content

Commit

Permalink
feat: set local name baseurl (#2)
Browse files Browse the repository at this point in the history
* fix: gomail dialer set LocalName

- this fixes rejected emails by google gmail smtp relay services
- no localhost HELO message

* fix: change LocalName for HELO to host according to RFC 5321

---------

Co-authored-by: SaschTa <[email protected]>
  • Loading branch information
saschTa and SaschTa authored Mar 28, 2024
1 parent 01f6848 commit d5ce795
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions mailme.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ func (m *Mailer) Mail(to, subjectTemplate, templateURL, defaultTemplate string,
mail.SetBody("text/html", body)

dial := gomail.NewPlainDialer(m.Host, m.Port, m.User, m.Pass)
dial.LocalName = m.Host
return dial.DialAndSend(mail)

}
Expand Down

0 comments on commit d5ce795

Please sign in to comment.