Closed suntong closed 10 months ago
Hi @suntong,
you can already send simple HTML mails by just using SetBodyString()
with TypeTextHTML
as your content type. Example: m.SetBodyString(TypeTextHTML, "<p>This is HTML</p>"
. If you wanna combine HTML and Text parts, you can make use of m.AddAlternativeString()
with the alternative content type.
References:
The reason we have HTML and Text of the functions that accept templates is, that they make use of the two different template packages from the standard library and therefore need to be distinguished by name.
Oh, thanks!
Is your feature request related to a problem? Please describe.
The
m.SetBodyHTMLTemplate
would make it very difficult to programmatically switching between sending plain text or html email, while having am.SetBodyHTML
would make the task trivial.Describe the solution you'd like
Can we have
m.SetBodyHTML
that accept a html body string, instead of a template and ad interface{}
please?Please consider. thx. I can work on the PR.
Describe alternatives you've considered
No response
Additional context
No response