mirror of
https://github.com/hrfee/jfa-go.git
synced 2024-12-22 17:10:10 +00:00
SMTP: Always use plaintext as main body
Adding the HTML as the alternative body caused the plaintext email to always appear. Should fix #164.
This commit is contained in:
parent
f78fa28822
commit
36f3860c4c
8
email.go
8
email.go
@ -170,11 +170,9 @@ func (sm *SMTP) Send(fromName, fromAddr string, email *Message, address ...strin
|
|||||||
e.SetFrom(from)
|
e.SetFrom(from)
|
||||||
e.SetSubject(email.Subject)
|
e.SetSubject(email.Subject)
|
||||||
e.AddTo(address...)
|
e.AddTo(address...)
|
||||||
if email.HTML == "" {
|
e.SetBody(sMail.TextPlain, email.Text)
|
||||||
e.SetBody(sMail.TextPlain, email.Text)
|
if email.HTML != "" {
|
||||||
} else {
|
e.AddAlternative(sMail.TextHTML, email.HTML)
|
||||||
e.SetBody(sMail.TextHTML, email.HTML)
|
|
||||||
e.AddAlternative(sMail.TextPlain, email.Text)
|
|
||||||
}
|
}
|
||||||
err = e.Send(cli)
|
err = e.Send(cli)
|
||||||
return err
|
return err
|
||||||
|
Loading…
Reference in New Issue
Block a user