修复邮箱图片显示逻辑,兼容 google gmail

This commit is contained in:
bjdgyc
2024-03-22 16:45:11 +08:00
parent eb7401f6e5
commit e5c6533c9b
4 changed files with 23 additions and 4 deletions

View File

@@ -43,7 +43,7 @@ func GetJwtData(jwtToken string) (map[string]interface{}, error) {
return claims, nil
}
func SendMail(subject, to, htmlBody string) error {
func SendMail(subject, to, htmlBody string, attach *mail.File) error {
dataSmtp := &dbdata.SettingSmtp{}
err := dbdata.SettingGet(dataSmtp)
@@ -102,6 +102,10 @@ func SendMail(subject, to, htmlBody string) error {
AddTo(to).
SetSubject(subject)
if attach != nil {
email.Attach(attach)
}
email.SetBody(mail.TextHTML, htmlBody)
// Call Send and pass the client