Sending mail using SSL/TLS with Go
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

tlsmail - Sending mail using SSL/TLS with Go

Solution is fully compatible with UTF-8

Install the package using go get

Package usage is as simple as shown below, send mails just with one line of code :)

package main

import (


const subject = "utf-8 mail: mail subject, тема сообщения, メール件名, 邮件主题"

const body = `
hi, привет, こんにちは, 嗨,

utf-8 body: message, сообщение, メッセージ, 信息

Message sent using GO package


func main() {

	mail := tlsmail.TLSMail{
		Host:     "",           // smtp & auth host
		Port:     "465",                                                // Default port
		Sender:   "",                             // sender mail id
		Password: "123456",                                             // sender mail password
		TO:       []string{"", ""}, // recipients in TO, can be a list
		CC:       []string{"", ""}, // recipients in CC, can be a list
		Subject:  subject,                                              // Subject in UTF-8
		Body:     body,                                                 // Mail in UTF-8

	err := mail.Send()

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

This example can be found here:

Feel free to create issues or send me pull requests.

Find more cool stuff in my blog