From 8dc4458ab91e0f12a063ee609516985bd4aa1d14 Mon Sep 17 00:00:00 2001 From: Ivy Evans Date: Wed, 6 Dec 2017 12:47:28 -0800 Subject: [PATCH] Add syntax highlighting to Go example --- README.md | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 6b549af..6c43b82 100644 --- a/README.md +++ b/README.md @@ -52,20 +52,22 @@ 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`: - package main +```go +package main - import ( - "crypto/tls" +import ( + "crypto/tls" - "github.com/go-mail/gomail" - ) + "github.com/go-mail/gomail" +) - func main() { - d := gomail.NewDialer("smtp.example.com", 587, "user", "123456") - d.TLSConfig = &tls.Config{InsecureSkipVerify: true} +func main() { + d := gomail.NewDialer("smtp.example.com", 587, "user", "123456") + d.TLSConfig = &tls.Config{InsecureSkipVerify: true} - // Send emails using d. - } + // Send emails using d. +} +``` Note, however, that this is insecure and should not be used in production.