mc9
mc9

Reputation: 6349

How does Email package decide whether to send html or text?

I would like to know how Email package chooses to send html or text version of an email.

The doc for Email.send says:

Email.send(options)

...

options

...

text, html (String)

Mail body (in plain text and/or HTML)

So it seems that we can supply both text and html. Any information?

Upvotes: 0

Views: 106

Answers (1)

MasterAM
MasterAM

Reputation: 16478

Under the hood, Meteor's Email package uses mailcomposer for mail composition.

If the options object includes both html and text, both of them will be sent in a multipart/alternative content-type email massage and the email client will be able to choose which one to display (the HTML, for any modern client).

You can easily test this by sending some emails with text/html/both and look at their source.

Upvotes: 2

Related Questions