|
|
@ -38,14 +38,12 @@ func NewMessageFrom(to []string, from, subject, htmlBody string) *Message { |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
log.Error(4, "html2text.FromString: %v", err) |
|
|
|
log.Error(4, "html2text.FromString: %v", err) |
|
|
|
msg.SetBody("text/html", htmlBody) |
|
|
|
msg.SetBody("text/html", htmlBody) |
|
|
|
msg.AddAlternative("text/html", htmlBody) |
|
|
|
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|
msg.SetBody("text/plain", body) |
|
|
|
msg.SetBody("text/plain", body) |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if setting.MailService.EnableHTMLAlternative { |
|
|
|
if setting.MailService.EnableHTMLAlternative { |
|
|
|
msg.AddAlternative("text/html", htmlBody) |
|
|
|
msg.AddAlternative("text/html", htmlBody) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return &Message{ |
|
|
|
return &Message{ |
|
|
|
Message: msg, |
|
|
|
Message: msg, |
|
|
|