I'm having trouble getting my email's body text in UTF-8. My markdown report is ok, and the script works when running from RStudio
- i.e body text is in UTF-8. My problem is that when I run the script from command line my email message is encoded using windows-1252 which I don't really want.
How do I set up my code to specify my emails header to have content type UTF-8? InternetCodepage doesn't work atleast
R-code below:
## Bodytext
bodyMail <- paste(__My UTF-8 message goes here__, sep = "")
# init com api
OutApp <- COMCreate("Outlook.Application")
# Create email
outMail = OutApp$CreateItem(0)
# Params
outMail[["InternetCodePage"]] = "65001"
outMail[["To"]] = __your_outlook_email___
outMail[["subject"]] = "Subject_text"
outMail[["BodyFormat"]] = "2"
outMail[["HTMLBody"]] = bodyMail
outMail[["Attachments"]]$Add(__path_to_html_report__)
## send it
outMail$Send()