diff --git a/mime.go b/mime.go index a60fb2d..83b3555 100644 --- a/mime.go +++ b/mime.go @@ -97,9 +97,11 @@ func (email Email) WriteMime(dest io.Writer) error { dest.Write([]byte("From: " + email.From + "\r\n")) dest.Write([]byte("To: " + email.To + "\r\n")) if email.ReturnPath != "" { - dest.Write([]byte("Return-Path: <" + email.ReturnPath + ">\r\n")) - } else { - dest.Write([]byte("Return-Path: <" + email.From + ">\r\n")) + if email.ReturnPath[0] == "<" { + dest.Write([]byte("Return-Path: " + email.ReturnPath + "\r\n")) + } else { + dest.Write([]byte("Return-Path: <" + email.ReturnPath + ">\r\n")) + } } if email.ReplyTo != "" { dest.Write([]byte("Reply-To: " + email.ReplyTo + "\r\n"))