func ExampleEmail_AddAttachment() {
	mail := new(MailService)
	mail.FromUsername = "no-reply"
	mail.FromName = "No Reply"
	mail.FromDomain = "example.com"
	email := mail.NewEmail()
	email.AddAttachment("testName", "testType", nil)
	fmt.Printf("attachment: %s", email.Attachments[0].FileName)
}
ExampleEmail_AddAttachment example using the AddAttachment()
package gomail
import (
	"fmt"
	"html/template"
	"io/ioutil"
	"path/filepath"
	"testing"
)
func TestMailService_NewEmail(t *testing.T) {
	t.Parallel()
	mail := new(MailService)
	mail.AutoText = true
	mail.FromUsername = "no-reply"
	mail.FromName = "No Reply"
	mail.FromDomain = "example.com"
	mail.Important = true
	email := mail.NewEmail()
	if email.FromAddress != mail.FromUsername+"@"+mail.FromDomain {
		t.Fatalf("%s: FromAddress is invalid", t.Name())
	}
	if email.ReplyToAddress != email.FromAddress {
		t.Fatalf("%s: ReplyToAddress is invalid", t.Name())
	}
	if !email.AutoText {
		t.Fatalf("%s: AutoText is invalid", t.Name())
	}
	if !email.Important {
		t.Fatalf("%s: Important is invalid", t.Name())
	}
	if email.FromName != mail.FromName {
		t.Fatalf("%s: FromName is invalid", t.Name())
	}
}
func ExampleMailService_NewEmail() {
	mail := new(MailService)
	mail.FromUsername = "no-reply"
	mail.FromName = "No Reply"
	mail.FromDomain = "example.com"
	email := mail.NewEmail()
	fmt.Printf("new email with from address: %s", email.FromAddress)
}
func BenchmarkMailService_NewEmail(b *testing.B) {
	mail := new(MailService)
	mail.FromUsername = "no-reply"
	mail.FromName = "No Reply"
	mail.FromDomain = "example.com"
	for i := 0; i < b.N; i++ {
		_ = mail.NewEmail()
	}
}
func TestEmail_AddAttachment(t *testing.T) {
	t.Parallel()
	mail := new(MailService)
	mail.FromUsername = "no-reply"
	mail.FromName = "No Reply"
	mail.FromDomain = "example.com"
	email := mail.NewEmail()
	email.AddAttachment("testName", "testType", nil)
	email.AddAttachment("testName2", "testType2", nil)
	if len(email.Attachments) != 2 {
		t.Fatalf("%s: expected 2 attachments, got: %d", t.Name(), len(email.Attachments))
	}
	if email.Attachments[0].FileName != "testName" || email.Attachments[0].FileType != "testType" {
		t.Fatalf("%s: expected value was wrong, got: %s", t.Name(), email.Attachments[0].FileName)
	}
	if email.Attachments[1].FileName != "testName2" || email.Attachments[1].FileType != "testType2" {
		t.Fatalf("%s: expected value was wrong, got: %s", t.Name(), email.Attachments[0].FileName)
	}
}