我正在看这个例子。http://golang.org/pkg/net/smtp/#example_PlainAuth
package main
import (
"log"
"net/smtp"
)
func main() {
// Set up authentication information.
auth := smtp.PlainAuth("", "user@example.com", "password", "mail.example.com")
to := []string{"recipient@example.net"}
mesg := []byte("This is the email body.")
err := smtp.SendMail("mail.example.com:25", auth, "sender@example.org", to, mesg)
if err != nil {
log.Fatal(err)
}
}
是否smtp.PlainAuth以纯文本形式向邮件服务器发送凭据?在野外使用 net/smtp 是否安全?
浮云间
相关分类