func (email *Email) AddTo(addresses ...string) *Email {
	if email.Error != nil {
		return email
	}
	email.AddAddresses("To", addresses...)
	return email
}
AddTo adds a To address. You can provide multiple
addresses at the same time.
package mail
import (
	"bytes"
	"crypto/tls"
	"errors"
	"fmt"
	"net"
	"net/mail"
	"net/textproto"
	"strconv"
	"time"
)
type Email struct {
	from        string
	sender      string
	replyTo     string
	returnPath  string
	recipients  []string
	headers     textproto.MIMEHeader
	parts       []part
	attachments []*File
	inlines     []*File
	Charset     string
	Encoding    encoding
	Error       error
	SMTPServer  *smtpClient
}
type SMTPServer struct {
	Authentication AuthType
	Encryption     Encryption
	Username       string
	Password       string
	Helo           string
	ConnectTimeout time.Duration
	SendTimeout    time.Duration
	Host           string
	Port           int
	KeepAlive      bool
	TLSConfig      *tls.Config
}
type SMTPClient struct {
	Client      *smtpClient
	KeepAlive   bool
	SendTimeout time.Duration
}
type part struct {
	contentType string
	body        *bytes.Buffer
}
type Encryption int
const (
	EncryptionNone Encryption = iota
	EncryptionSSL
	EncryptionTLS
	EncryptionSSLTLS
	EncryptionSTARTTLS
)
var encryptionTypes = [...]string{"None", "SSL/TLS", "STARTTLS", "SSL/TLS", "STARTTLS"}
func (encryption Encryption) String() string {
	return encryptionTypes[encryption]
}
type encoding int
const (
	EncodingNone encoding = iota
	EncodingBase64
	EncodingQuotedPrintable
)
var encodingTypes = [...]string{"binary", "base64", "quoted-printable"}
func (encoding encoding) string() string {
	return encodingTypes[encoding]
}
type contentType int
const (
	TextPlain contentType = iota
	TextHTML
	TextCalendar
)
var contentTypes = [...]string{"text/plain", "text/html", "text/calendar"}
func (contentType contentType) string() string {
	return contentTypes[contentType]
}
type AuthType int
const (
	AuthPlain AuthType = iota
	AuthLogin
	AuthCRAMMD5
	AuthNone
)
func NewMSG() *Email {
	email := &Email{
		headers:  make(textproto.MIMEHeader),
		Charset:  "UTF-8",
		Encoding: EncodingQuotedPrintable,
	}
	email.AddHeader("MIME-Version", "1.0")
	return email
}
func NewSMTPClient() *SMTPServer {
	server := &SMTPServer{
		Authentication: AuthPlain,
		Encryption:     EncryptionNone,
		ConnectTimeout: 10 * time.Second,
		SendTimeout:    10 * time.Second,
		Helo:           "localhost",
	}
	return server
}
func (server *SMTPServer) GetEncryptionType() Encryption {
	return server.Encryption
}
func (email *Email) GetError() error {
	return email.Error
}
func (email *Email) SetFrom(address string) *Email {
	if email.Error != nil {
		return email
	}
	email.AddAddresses("From", address)
	return email
}
func (email *Email) SetSender(address string) *Email {
	if email.Error != nil {
		return email
	}
	email.AddAddresses("Sender", address)
	return email
}
func (email *Email) SetReplyTo(address string) *Email {
	if email.Error != nil {
		return email
	}
	email.AddAddresses("Reply-To", address)
	return email
}
func (email *Email) SetReturnPath(address string) *Email {
	if email.Error != nil {
		return email
	}
	email.AddAddresses("Return-Path", address)
	return email
}