2016-07-11 1 views
0
library("mailR") 
    sender <- "[email protected]" 
    bcc<- c("BCC Recipient <[email protected]>","BCC Recipient<[email protected]>") 
    send.mail(from = sender, 
       bcc<- c("BCC Recipient <[email protected]>","BCC Recipient<[email protected]>"), 
       subject = "subject", 
       body = "BODY 
       ", 
       authenticate=TRUE, 
       smtp = list(host.name = "smtp.gmail.com", port = 465, 
          user.name = "[email protected]",    
          passwd = "YOURPASSWORD", ssl = TRUE), 
       send = TRUE, 
       attach.files = c("C:/Users/admin/Desktop/Forecast.csv"), 
       file.names = c("Demand_Forecast.csv")) 

и знают, как отправить почту с ОЦК, что формат делать? Это работает, но recipents могут видеть друг другаКто-нибудь знает, как сделать ставку в R?

ответ

1

Вы ошибочно использовали оператор присваивания внутри функции send.mail().

Это должно работать:

library("mailR") sender <- "[email protected]" bcc<- c("BCC Recipient <[email protected]>","BCC Recipient<[email protected]>") send.mail(from = sender, bcc = c("BCC Recipient <[email protected]>","BCC Recipient<[email protected]>"), subject = "subject", body = "BODY", authenticate=TRUE, smtp = list(host.name = "smtp.gmail.com", port = 465, user.name = "[email protected]",
passwd = "YOURPASSWORD", ssl = TRUE), send = TRUE, attach.files = c("C:/Users/admin/Desktop/Forecast.csv"), file.names = c("Demand_Forecast.csv"))