How to send HTML email using R

前端 未结 5 901
慢半拍i
慢半拍i 2020-12-16 02:44

I have searched SO and well as google and cannot seem to find a solution to my problem. I am trying to send a HTML formatted email within R using sendmailR package. The plai

5条回答
  •  有刺的猬
    2020-12-16 02:58

    With the mailR package (https://github.com/rpremraj/mailR), you could send HTML emails with ease as below:

    send.mail(from = "sender@gmail.com",
              to = c("recipient1@gmail.com", "recipient2@gmail.com"),
              subject = "Subject of the email",
              body = "The apache logo - ",
              html = TRUE,
              smtp = list(host.name = "smtp.gmail.com", port = 465, user.name = "gmail_username", passwd = "password", ssl = TRUE),
              attach.files = c("./download.log", "upload.log"),
              authenticate = TRUE,
              send = TRUE)
    

提交回复
热议问题