Explorar o código

fix: improve error handling for email sending failures

CaIon hai 4 meses
pai
achega
5fc9152499
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  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
 }