From 0b654843f02db81c1a66d45aa5af287a824ec653 Mon Sep 17 00:00:00 2001 From: AlexAkulov Date: Wed, 4 May 2016 20:00:17 +0500 Subject: [PATCH] mail_from value required for mail sender --- mail/mail.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mail/mail.go b/mail/mail.go index 08e23d8..a9804c1 100644 --- a/mail/mail.go +++ b/mail/mail.go @@ -106,6 +106,9 @@ func (sender *Sender) Init(senderSettings map[string]string, logger *logging.Log sender.Username = sender.From } // test settings + if sender.From == "" { + return fmt.Errorf("mail_from can't be empty") + } t, err := smtp.Dial(fmt.Sprintf("%s:%d", sender.SMTPhost, sender.SMTPport)) if err != nil { return err