func (msg *Message) DelHeader(field string) {
	delete(msg.header, field)
}
DelHeader deletes a header field.
package gomail
import (
	"bytes"
	"io"
	"io/ioutil"
	"net/smtp"
	"path/filepath"
	"time"
	"github.com/alexcesaro/mail/mailer"
	"github.com/alexcesaro/mail/quotedprintable"
)
const (
	QuotedPrintable = "quoted-printable"
	Base64 = "base64"
)
type Message struct {
	header      header
	parts       []part
	attachments []attachment
	charset     string
	encoding    string
	hEncoder    *quotedprintable.HeaderEncoder
}
type header map[string][]string
type part struct {
	contentType string
	body        *bytes.Buffer
}
type attachment struct {
	name    string
	content []byte
}
func NewCustomMessage(charset, encoding string) *Message {
	var enc string
	if encoding == Base64 {
		enc = quotedprintable.B
	} else {
		enc = quotedprintable.Q
	}
	encoder, _ := quotedprintable.NewHeaderEncoder(charset, enc)
	return &Message{
		header:      make(header),
		parts:       make([]part, 0),
		attachments: make([]attachment, 0),
		charset:     charset,
		encoding:    encoding,
		hEncoder:    encoder,
	}
}
func NewMessage() *Message {
	return NewCustomMessage("UTF-8", QuotedPrintable)
}
func (msg *Message) SetHeader(field, value string) {
	msg.header[field] = []string{msg.encodeHeader(value)}
}
func (msg *Message) AddHeader(field, value string) {
	msg.header[field] = append(msg.header[field], msg.encodeHeader(value))
}
func (msg *Message) encodeHeader(value string) string {
	return msg.hEncoder.EncodeHeader(value)
}
func (msg *Message) SetAddressHeader(field, address, name string) {
	msg.header[field] = []string{msg.buildAddressHeader(address, name)}
}
func (msg *Message) AddAddressHeader(field, address, name string) {
	msg.header[field] = append(msg.header[field], msg.buildAddressHeader(address, name))
}
func (msg *Message) buildAddressHeader(address, name string) string {
	return msg.encodeHeader(name) + " <" + address + ">"
}
func (msg *Message) SetDateHeader(field string, date time.Time) {
	msg.header[field] = []string{buildDateHeader(date)}
}
func (msg *Message) AddDateHeader(field string, date time.Time) {
	msg.header[field] = append(msg.header[field], buildDateHeader(date))
}
func buildDateHeader(date time.Time) string {
	return date.Format(time.RFC822)
}
func (msg *Message) GetHeader(field string) []string {
	return msg.header[field]
}