メールの本文を UTF-8 で取得できません。私のマークダウンレポートは問題ありません。スクリプトは実行時に機能しRStudioます。つまり、本文テキストは UTF-8 です。私の問題は、コマンド ラインからスクリプトを実行すると、電子メール メッセージが Windows-1252 を使用してエンコードされることです。
電子メールのヘッダーに UTF-8 のコンテンツ タイプを指定するようにコードを設定するにはどうすればよいですか? InternetCodepage は少なくとも動作しません
以下のRコード:
## 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()