From 3f18d6d1a6c352a8b5c921f84455544ed7af9799 Mon Sep 17 00:00:00 2001 From: Alexandre Cesaro Date: Sat, 5 Mar 2016 17:24:14 +0100 Subject: [PATCH] Fixed the FAQ example Fixes #50 --- README.md | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1d17712..c23be4a 100644 --- a/README.md +++ b/README.md @@ -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.