下面是创建用于通过r
发送电子邮件的代码。
OutApp <- COMCreate("Outlook.Application")
outMail = OutApp$CreateItem(0)
outMail[["To"]] = "personperson@gmail.com"
outMail[["subject"]] = "SUBJECT"
outMail[["body"]] = paste("Hello","Below are the contents of the email")
outMail$Send()
输出为:
Hello Below are the contents of the email
输出应为:
Hello
Below are the contents of the email
感谢您的帮助。
答案 0 :(得分:1)
如果您有两个元素
a <- "hello"
b <- "World"
,您需要两行打印,可以将writeLines
与paste
一起使用:
> writeLines(paste(a, b, sep = "\n"))
hello
World