1
0
mirror of https://github.com/golang/go synced 2024-11-22 02:54:39 -07:00

net/smtp: clarify that SendMail's auth param is optional

It wasn't obvious that the Auth could be nil.

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/13060048
This commit is contained in:
Brad Fitzpatrick 2013-08-27 16:12:11 -07:00
parent a85cfbd433
commit c7c1a1bbaa

View File

@ -264,9 +264,10 @@ func (c *Client) Data() (io.WriteCloser, error) {
return &dataCloser{c, c.Text.DotWriter()}, nil
}
// SendMail connects to the server at addr, switches to TLS if possible,
// authenticates with mechanism a if possible, and then sends an email from
// address from, to addresses to, with message msg.
// SendMail connects to the server at addr, switches to TLS if
// possible, authenticates with the optional mechanism a if possible,
// and then sends an email from address from, to addresses to, with
// message msg.
func SendMail(addr string, a Auth, from string, to []string, msg []byte) error {
c, err := Dial(addr)
if err != nil {