Browse Source

Use proper hostname instead of "localhost" for outgoing mails

Bernhard Froehlich 6 years ago
parent
commit
ab850e8765
1 changed files with 1 additions and 1 deletions
  1. 1 1
      smtp.go

+ 1 - 1
smtp.go

@@ -67,7 +67,7 @@ func NewClient(conn net.Conn, host string) (*Client, error) {
 		text.Close()
 		return nil, err
 	}
-	c := &Client{Text: text, conn: conn, serverName: host, localName: "localhost"}
+	c := &Client{Text: text, conn: conn, serverName: host, localName: *hostName}
 	_, c.tls = conn.(*tls.Conn)
 	return c, nil
 }