I have R Studio version 3.4.3. I'm having a problem sending emails to min 2 people (in the future to over 100 people).
For example: Mail to one person. Here everything is ok. This is code:
library(RDCOMClient)
OutApp <- COMCreate("Outlook.Application")
outMail = OutApp$CreateItem(0)
to="a@outlook.pl"
outMail[["To"]] =to
outMail[["subject"]] = "Mail R Studio"
outMail[["body"]] = "body mail"
outMail$Send()
So, let's send mail to 2 people. I do it this:
mailing_list <- data.frame(to = c('a@outlook.pl','a@outlook.pl'),
subject = c('Mail R Studio','Mail R Studio'),
body = c('Please, help me','Please, help me')
for (i in 1:nrow(mailing_list)) {
OutApp <- COMCreate("Outlook.Application")
outMail = OutApp$CreateItem(0)
outMail[["To"]] = mailing_list[i,1]
outMail[["subject"]] = mailing_list[i,2]
outMail[["body"]] = mailing_list[i,3]
outMail$Send()
}
Error code:
Error in `[[<-`(`tmp`, "To", value = 1L) :
Can't attach the RDCOMServer package needed to create a generic COM object In addition: Warning message: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE, : nie ma pakietu o nazwie ‘RDCOMServer’
But when I install.packages("RDCOMServer") feedback is:
Warning in install.packages :
package ‘RDCOMServer’ is not available (for R version 3.4.3)
Please, help me do that! Thanks