Explorar o código

Use proper hostname instead of "localhost" for outgoing mails

Bernhard Froehlich %!s(int64=6) %!d(string=hai) anos
pai
achega
ab850e8765
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  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
 }