mail/smtp_sender.go
func (sm SMTPSender) Send(message Message) error {
	gm := gomail.NewMessage()

	gm.SetHeader("From", message.From)
	gm.SetHeader("To", message.To...)
	gm.SetHeader("Subject", message.Subject)
	gm.SetHeader("Cc", message.CC...)
	gm.SetHeader("Bcc", message.Bcc...)

	sm.addBodies(message, gm)
	sm.addAttachments(message, gm)

	for field, value := range message.Headers {
		gm.SetHeader(field, value)
	}

	err := sm.Dialer.DialAndSend(gm)

	if err != nil {
		return err
	}

	return nil
}
func (sm SMTPSender) Send(message Message) error {
	gm := gomail.NewMessage()

	gm.SetHeader("From", message.From)
	gm.SetHeader("To", message.To...)
	gm.SetHeader("Subject", message.Subject)
	gm.SetHeader("Cc", message.CC...)
	gm.SetHeader("Bcc", message.Bcc...)

	sm.addBodies(message, gm)
	sm.addAttachments(message, gm)

	for field, value := range message.Headers {
		gm.SetHeader(field, value)
	}

	err := sm.Dialer.DialAndSend(gm)

	if err != nil {
		return err
	}

	return nil
}
//Send a message using SMTP configuration or returns an error if something goes wrong.