Browse Source

fix: improve error handling for email sending failures

CaIon 2 months ago
parent
commit
5fc9152499
1 changed files with 3 additions and 0 deletions
  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
 }