diff --git a/emailer/smtp.go b/emailer/smtp.go index f77db7c..7bc22fe 100644 --- a/emailer/smtp.go +++ b/emailer/smtp.go @@ -13,6 +13,7 @@ type SmtpMail struct { port int username string password string + helloHostName string authType mail.AuthType encryption mail.Encryption noTLSCheck bool @@ -46,8 +47,8 @@ func encryptionType(encryptionType string) mail.Encryption { } } -func NewSmtpMail(hostname string, port int, username string, password string, noTLSCheck bool, auth string, fromName, from string, encryption string) *SmtpMail { - ans := SmtpMail{hostname: hostname, port: port, username: username, password: password, noTLSCheck: noTLSCheck, fromName: fromName, from: from, authType: authType(auth), encryption: encryptionType(encryption)} +func NewSmtpMail(hostname string, port int, username string, password string, helloHostName string, noTLSCheck bool, auth string, fromName, from string, encryption string) *SmtpMail { + ans := SmtpMail{hostname: hostname, port: port, username: username, password: password, helloHostName: helloHostName, noTLSCheck: noTLSCheck, fromName: fromName, from: from, authType: authType(auth), encryption: encryptionType(encryption)} return &ans } @@ -66,6 +67,7 @@ func (o *SmtpMail) Send(toName string, to string, subject string, content string server.Authentication = o.authType server.Username = o.username server.Password = o.password + server.Helo = o.helloHostName server.Encryption = o.encryption server.KeepAlive = false server.ConnectTimeout = 10 * time.Second