rpremraj / mailR

A utility to send emails from the R programming environment
http://rpremraj.github.io/mailR/
190 stars 57 forks source link

change behavior of 'html' argument #46

Closed dtenenba closed 8 years ago

dtenenba commented 8 years ago

If a user is sending plain-text (non-html) emails, the emails do not need to say "The contents of the original email have been modified...". And similarly, we do not need to strip out HTML tags from the plain text email, because if the user specified html=FALSE when invoking send.mail(), we can assume they want any HTML tags in the email body to be sent as part of the plain text.

Conversely, if html=TRUE, then we should not set the plain text component of the message to be "Your email client does not support HTML messages". For example, with the Zimbra Web Client, in the preview pane where it pulls out the first few words of the email for easy viewing, it shows this error message but it should show the text of the email:

mailpreviewzimbra

This could be an issue with this particular client, but anyway, this fixes it. So now the "text" portion of an HTML message is set to .stripHTML(body).

Thanks for a very useful package.