Kaynağa Gözat

fix: improve error handling for email sending failures

CaIon 5 ay önce
ebeveyn
işleme
5fc9152499
1 değiştirilmiş dosya ile 3 ekleme ve 0 silme
  1. 3 0
      common/email.go

+ 3 - 0
common/email.go

@@ -86,5 +86,8 @@ func SendEmail(subject string, receiver string, content string) error {
 	} else {
 		err = smtp.SendMail(addr, auth, SMTPFrom, to, mail)
 	}
+	if err != nil {
+		SysError(fmt.Sprintf("failed to send email to %s: %v", receiver, err))
+	}
 	return err
 }