how do you send email from R

后端 未结 8 909
情书的邮戳
情书的邮戳 2020-11-29 18:11

I want to send emails from R. This is what I have so far:

library(sendmailR)


from <- \"eamil@example.com\"
to <- \"email2@example.com\"
subject <-         


        
8条回答
  •  失恋的感觉
    2020-11-29 18:34

    library(mailR)
    sender <- "abc@gmail.com"
    
    recipients <- c("bcd@gmail.com","xyz@gmail.com")
    
    send.mail(
        from = sender, 
         to = recipients, 
         subject="Cash_Collected_Bank_transfer",
         Sys.Date(),
         "{}", body = Summary1, encoding = "utf-8", smtp = 
             list(host.name = "smtp.gmail.com", port = 465, 
             user.name="abc@gmail.com", passwd="abc@1234", ssl=TRUE), 
         authenticate = TRUE, send = TRUE ,
         attach.files = c(path2), html = TRUE , inline = TRUE )
    

提交回复
热议问题