r - 抑制 Outlook 弹出窗口允许在 R 中访问
问题描述
我在 R 中制作了一个脚本,该脚本通过 Outlook 中的邮件搜索确定的电子邮件。问题是每次脚本尝试访问我的电子邮件时,都会弹出一个窗口并请求许可。该脚本按预期工作,但进程减慢,因为我每次都必须在那里单击“允许”。我已经读到可以允许程序在 Trusct Center 选项中进入我的 Outlook,但 Windows 版本太旧,无法通过这种方式进行修复。此外,由于这是一个共享服务器,我没有管理员访问权限,因此无法进行重大更改。我读过其他类似的问题,但在 R 中没有,像这样[禁止 Outlook 弹出窗口允许访问或这个[如何在 PB8 中发送邮件时抑制 Outlook 弹出消息。这是我的脚本:
library(RDCOMClient)
library(stringr)
#Folder in OutLook where to look for the emails
folderName = "Specific folder"
OutApp <- COMCreate("Outlook.Application")
outlookNameSpace = OutApp$GetNameSpace("MAPI")
folder <- outlookNameSpace$Folders(1)$Folders(folderName)
folder$Name(1)
emails <- folder$Items
for (i in 1:emails()$Count()){
subject <- emails(i)$Subject() #Get the subject of the email
#If the subject of the email has an specific string print the body of the message
if (grepl("Subject to look for", subject)== TRUE){
body <- emails(i)$Body() # Here asks for permission
print(body)
}
}
有没有办法嵌入一段代码来避免这个弹出窗口或自动“点击”允许?
解决方案
看起来您在 Outlook 中遇到了标准的安全提示。有可能的路线,你可以去:
使用 Outlook 所基于的低级代码 - 扩展 MAPI 或围绕此 API 的任何其他第三方包装器,例如 Redemption。
在 Outlook - Microsoft Outlook 安全管理器中使用为关闭此类安全触发器而设计的第三方组件。
设置组策略以避免此类触发器。
在系统上设置有效的防病毒软件。
推荐阅读
- html - HTML/CSS 以 45 度角重复出现在元素外不可见的文本
- python - 使用 `TfidfVectorizer`、`CountVectorizer` 等时需要对标签进行编码吗?
- python - 命令引发异常:TypeError:字符串索引必须是整数
- python - 在DataFrame Python中计算有条件的项目
- sql - 如何从 group by 中的缺失行中获取 0 个结果
- chatterbot - ChatBot 是否有可以将响应关联为否定的功能?
- node.js - Heroku 部署成功但显示应用程序错误
- discord.js - 使用参数 Discord.JS 按名称将用户添加到角色
- function - 将一个函数的值分配给另一个函数
- php - 未定义的索引 - 数组偏移 | PHP 表单 | 索引似乎存在,但声明它不存在