Fixed the FAQ example

Fixes #50
This commit is contained in:
Alexandre Cesaro 2016-03-05 17:24:14 +01:00
parent dc65e3e648
commit 3f18d6d1a6
1 changed files with 14 additions and 2 deletions

View File

@ -51,8 +51,20 @@ considered valid by the client running Gomail. As a quick workaround you can
bypass the verification of the server's certificate chain and host name by using
`SetTLSConfig`:
d := gomail.NewPlainDialer("smtp.example.com", "user", "123456", 587)
d.TLSConfig = &tls.Config{InsecureSkipVerify: true}
package main
import (
"crypto/tls"
"gopkg.in/gomail.v2"
)
func main() {
d := gomail.NewPlainDialer("smtp.example.com", 587, "user", "123456")
d.TLSConfig = &tls.Config{InsecureSkipVerify: true}
// Send emails using d.
}
Note, however, that this is insecure and should not be used in production.