func New(host string, port int, username string, password string, from string, to []string) *Email {
	e := &Email{
		enabled:         true,
		timestampFormat: log.DefaultTimeFormat,
		host:            host,
		port:            port,
		username:        username,
		password:        password,
		from:            from,
		to:              to,
		formatFunc:      defaultFormatFunc,
	}
	e.SetTemplate(defaultTemplate)
	return e
}
New returns a new instance of the email logger
package email
import (
	"bytes"
	"html/template"
	"sync"
	gomail "gopkg.in/gomail.v2"
	"github.com/go-playground/log/v7"
)
type FormatFunc func(email *Email) Formatter
type Formatter func(e log.Entry) *gomail.Message
const (
	contentType     = "text/html"
	defaultTemplate = `<!DOCTYPE html>
<html>
    <body>
        <h2>{{ .Message }}</h2>
        <p>{{ .Level.String }}</p>
        <p>{{ ts . }}</p>
        {{ range $f := .Fields }}
            <p><b>{{ $f.Key }}</b>: {{ $f.Value }}</p>
        {{ end }}
    </body>
</html>`
)
type Email struct {
	enabled         bool
	formatter       Formatter
	formatFunc      FormatFunc
	timestampFormat string
	template        *template.Template
	host            string
	port            int
	username        string
	password        string
	from            string
	to              []string
	rw              sync.RWMutex
	once            sync.Once
}