go-gomail / gomail

The best way to send emails in Go.
MIT License
4.3k stars 570 forks source link

unencrypted connection #136

Open atdevp opened 5 years ago

atdevp commented 5 years ago

part code:

if host == "" || port == 0 || user == "" || passwd == "" { return &gomail.Dialer{}, errors.New("some smtp arg is null") }

client := gomail.NewDialer(host, port, user, passwd)
client.TLSConfig = &tls.Config{
    InsecureSkipVerify: true,
}
return client, nil
huojiao2006 commented 5 years ago

need to remove the restrict in net/smtp/ function Start()

//Attention!!! commented out to support some email server without TSL setting. //if !server.TLS && !isLocalhost(server.Name) { // return "", nil, errors.New("unencrypted connection") //} if server.Name != a.host { return "", nil, errors.New("wrong host name") } resp := []byte(a.identity + "\x00" + a.username + "\x00" + a.password) return "PLAIN", resp, nil