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

Do u know how to send mail with bcc, what is the format?It is working but recipents can see eachother

yole
  • 92,896
  • 20
  • 260
  • 197
bmerv
  • 33
  • 6

1 Answers1

1

You have mistakenly used the assignment operator inside the function send.mail().

This should work:

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

Rahul Premraj
  • 1,595
  • 14
  • 13