From 1139c96a2cdbbd686e7b1d074d8278fd960ef845 Mon Sep 17 00:00:00 2001 From: Chad Gilbert Date: Thu, 18 May 2017 13:14:49 -0400 Subject: [PATCH] Fix mishandled From address Some smtp servers will fail if you issue the MAIL command with an address surrounded by brackets. Likewise, using .Address here matches the smtp.SendMail call in the SendMail function above --- smtp.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/smtp.go b/smtp.go index 9b2ab7d..0123570 100644 --- a/smtp.go +++ b/smtp.go @@ -53,7 +53,7 @@ func SendTLSMail(addr string, a smtp.Auth, msg *Message, cfg tls.Config) error { to = append(to, address.Address) } - from := msg.From.String() + from := msg.From.Address c, err := smtp.Dial(addr) if err != nil {