r - RDCOMClient Outlook 在 R 中添加提醒
问题描述
我在 R 中使用此功能发送电子邮件,但是,我还想在电子邮件中添加“添加提醒”,以便稍后提醒操作收件人。可能吗?
谢谢
library(RDCOMClient)
mail_fun <- function(email, name, number) {
Outlook <- COMCreate("Outlook.Application")
Email = Outlook$CreateItem(0)
# Email parameters
#Email[["sentonbehalfofname"]] = ""
Email[["to"]] = email
Email[["cc"]] = ""
Email[["bcc"]] = ""
Email[["importance"]] = "2"
Email[["readreceiptrequested"]] = FALSE
Email[["originatordeliveryreportrequested"]] = FALSE
Email[["subject"]] = paste0("Confirm your Telia SIM card delivery with the phone number: ", number)
Email[["Body"]] = paste0("Dear ", name,",", "\n", "\n", "I would like to ask you for a confirmation that a new Telia SIM card with the phone number: ", number, " was delivered to you.",
" Your confirmation is very important for a successful porting from H3Gi to Telia. The porting is planned for September 14th 2021.", "\n",
"In case you have not received the SIM card yet, please let us know your delivery address and we will send you a new SIM card.",
"\n", "\n", "Thank you for your cooperation.", "\n", "\n", "Best regards,", "\n", "Jaroslav Kotrba")
# Email send
Email$Send()
}
# Send
mapply(mail_fun, DK$email, DK$name, DK$number)
解决方案
您有兴趣设置MailItem.FlagRequest属性,该属性返回或设置一个字符串,该字符串指示邮件项的请求操作。默认情况下,邮件项没有标记任何标志,并且此属性的默认值为空字符串。
Email[["flagrequest"]] = "Reply"
推荐阅读
- excel - 为数百万次计算优化宏
- asp.net-core - 标识为 0 的 Entity Framework Core 种子数据
- javascript - 当我想从 django 中的查询结果中提取信息时,它返回 none
- mysql - mySQL Mac终端错误登录(获取密钥图片)
- python - 需要帮助在 tkinter 中使用 matplotlib 绘制图形
- c# - 在 ASP.Net Core WebAPI 中模型绑定 HTTP 请求
- c++ - 我怎样才能根据我的代码正确设置这个贷款方程?
- php - 使用碳将UTC更改为其他时区给出相同的结果
- javascript - addEventListener 在我电脑浏览器上的故障
- c# - 通过 Azure Functions 在 Azure AD 中验证用户(验证用户名和密码)