fix: correct email headers (mime version and content-type) (#7886)

* fix: correct email mime version case for case-sensitive handlers

* remove trailing `;`

---------

Co-authored-by: Livio Spring <livio.a@gmail.com>
This commit is contained in:
Stefan Benz 2024-05-02 10:36:21 +02:00 committed by GitHub
parent 6c0e7c402d
commit 8cc12e869a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -51,9 +51,9 @@ func (msg *Email) GetContent() (string, error) {
} }
//default mime-type is html //default mime-type is html
mime := "MIME-version: 1.0;" + lineBreak + "Content-Type: text/html; charset=\"UTF-8\";" + lineBreak + lineBreak mime := "MIME-Version: 1.0" + lineBreak + "Content-Type: text/html; charset=\"UTF-8\"" + lineBreak + lineBreak
if !isHTML(msg.Content) { if !isHTML(msg.Content) {
mime = "MIME-version: 1.0;" + lineBreak + "Content-Type: text/plain; charset=\"UTF-8\";" + lineBreak + lineBreak mime = "MIME-Version: 1.0" + lineBreak + "Content-Type: text/plain; charset=\"UTF-8\"" + lineBreak + lineBreak
} }
subject := "Subject: " + bEncodeSubject(msg.Subject) + lineBreak subject := "Subject: " + bEncodeSubject(msg.Subject) + lineBreak
message += subject + mime + lineBreak + msg.Content message += subject + mime + lineBreak + msg.Content