net/smtp always uses localhost with helo command, and since localname in not exported in Client struct, you can't change it not to use localhost. Here you can find Client struct inside net/smtp/smtp.go :
// A Client represents a client connection to an SMTP server.
type Client struct {
// Text is the textproto.Conn used by the Client. It is exported to allow for
// clients to add extensions.
Text *textproto.Conn
// keep a reference to the connection so it can be used to create a TLS
// connection later
conn net.Conn
// whether the Client is using TLS
tls bool
serverName string
// map of supported extensions
ext map[string]string
// supported auth mechanisms
auth []string
localName string // the name to use in HELO/EHLO
didHello bool // whether we've said HELO/EHLO
helloError error // the error from the hello
}
This way it's not possible to start smtp with any other mail server not running on localhost.
net/smtp always uses localhost with helo command, and since localname in not exported in Client struct, you can't change it not to use localhost. Here you can find Client struct inside net/smtp/smtp.go :
This way it's not possible to start smtp with any other mail server not running on localhost.