Sending mail using TLS with Go

As I did not find any example of go program which is sending UTF-8 mail with TLS, I decided to create my own go package with this functionality + example, find more details here:


Mail message can be sent this easy:


mail := tlsmail.TLSMail{
	Host:     "",  
	Port:     "465",                           
	Sender:   "",        
	Password: "123456",                        
	TO:       []string{""},
	Subject:  subject,                       
	Body:     body,                          

err := mail.Send()

if err != nil {
	log.Println("Mail send failure: " + err.Error())
} else {
	log.Println("Mail sent successfully")


, , , , ,

  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: