相关疑难解决方法(0)

通过outlook在R中发送电子邮件

有谁知道是否可以通过Outlook在R中发送电子邮件.sendmailR的所有示例都使用gmail服务器.我不能这样做.有任何想法吗?

谢谢!

r

37
推荐指数
3
解决办法
3万
查看次数

使用 R 从 Microsoft Outlook 发送电子邮件时的 Html 表输出格式

我正在尝试使用htmlTable包将数据帧转换为 html 表,然后RDCOMClient通过附加 html 表作为电子邮件正文,使用 Microsoft Outlook 作为使用包的电子邮件客户端发送电子邮件。我是 HTML 编码的新手,所以我不太熟悉如何使用 HTML 标签格式化表格。下面是我正在尝试做的一个例子。

# Library to send email from Microsoft Outlook
library(RDCOMClient)
# Library to create HTML table
library(htmlTable)

# Reading data from inbuilt 'mtcars' dataset
x <- head(mtcars)

# Create HTML table
y <- htmlTable(x,
               rnames = FALSE,
               caption="This is from htmlTable package",
               align = paste(rep("c", ncol(x)), collapse = "|"),
               align.header = paste(rep("c", ncol(x)), collapse = "|"))

# add the table as body of the email …
Run Code Online (Sandbox Code Playgroud)

css outlook r html-email rdcomclient

5
推荐指数
1
解决办法
3173
查看次数

如何通过 R 在 Outlook 正文中显示 Excel 工作表

我可以通过 RDCOMClinet 包将 Excel 文件附加到 Outlook 中。但是如何通过R在邮件正文中显示excel工作表内容?假设工作表中包含一个表格和一个图形。

library(RDCOMClient)
## init com api
OutApp <- COMCreate("Outlook.Application")
## create an email
outMail = OutApp$CreateItem(0)

## configure  email parameter
outMail[["To"]] = "name@email.com"
outMail[["subject"]] = paste0("Report ", Sys.Date() - 1)

# attach a file via its directory
dirs <- dir(getwd(), full.names = TRUE)
outMail[["Attachments"]]$Add(dirs)

# insert an excel worksheet from attachment or local drive
outMail[["HTMLBody"]] = ?  
Run Code Online (Sandbox Code Playgroud)

email outlook r rdcomclient

4
推荐指数
1
解决办法
2944
查看次数

标签 统计

r ×3

outlook ×2

rdcomclient ×2

css ×1

email ×1

html-email ×1