首页 > 解决方案 > 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)

在此处输入图像描述

标签: routlook

解决方案


您有兴趣设置MailItem.FlagRequest属性,该属性返回或设置一个字符串,该字符串指示邮件项的请求操作。默认情况下,邮件项没有标记任何标志,并且此属性的默认值为空字符串。

Email[["flagrequest"]] = "Reply"

推荐阅读