func TestSendMail(t *testing.T) {
	client := mail.NewSMTPClient()
	client.Host = host
	client.Port = port
	client.Username = username
	client.Password = password
	client.Encryption = encryptionType
	client.ConnectTimeout = connectTimeout
	client.SendTimeout = sendTimeout
	client.KeepAlive = false
	smtpClient, err := client.Connect()
	if err != nil {
		t.Error("Expected nil, got", err, "connecting to client")
	}
	err = smtpClient.Noop()
	if err != nil {
		t.Error("Expected nil, got", err, "noop to client")
	}
	email := mail.NewMSG()
	email.SetFrom("From Example <test@example.com>").
		AddTo("admin@example.com").
		SetSubject("New Go Email")
	email.SetBody(mail.TextHTML, htmlBody)
	email.AddAlternative(mail.TextPlain, "Hello Gophers!")
	email.SetSender("xhit@test.com")
	email.SetReplyTo("replyto@reply.com")
	email.SetReturnPath("test@example.com")
	email.AddCc("cc@example1.com")
	email.AddBcc("bcccc@example2.com")
	email.Attach(&mail.File{FilePath: "C:/Users/sdelacruz/Pictures/Gopher.png", Inline: true})
	email.Attach(&mail.File{FilePath: "C:/Users/sdelacruz/Pictures/Gopher.png"})
	email.Attach(&mail.File{B64Data: "Zm9v", Name: "filename"})
	email.SetDate("2015-04-28 10:32:00 CDT")
	email.SetPriority(mail.PriorityLow)
	if email.Error != nil {
		t.Error("Expected nil, got", email.Error, "generating email")
	}
	err = email.Send(smtpClient)
	email.GetError()
	if err != nil {
		t.Error("Expected nil, got", err, "sending email")
	}
}
TestSendMailWithAttachment send a simple html email.
package example
import (
	"testing"
	"time"
	mail "github.com/xhit/go-simple-mail/v2"
)
var (
	htmlBody = `<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>Hello Gophers!</title>
	</head>
	<body>
		<p>This is the <b>Go gopher</b>.</p>
		<p><img src="cid:Gopher.png" alt="Go gopher" /></p>
		<p>Image created by Renee French</p>
	</body>
</html>`
	host           = "localhost"
	port           = 25
	username       = "test@example.com"
	password       = "santiago"
	encryptionType = mail.EncryptionNone
	connectTimeout = 10 * time.Second
	sendTimeout    = 10 * time.Second
)