how do you send email from R

后端 未结 8 925
情书的邮戳
情书的邮戳 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:46

    If you prefer an in-house solution with your server, you can call the linux sendmail.

    EMAIL <- myEmail@gmail.com
    cmd <- 'subject="Info server";body="This is an email"'
    cmd <- paste("echo -e \"Subject:${subject}\n${body}\" | /usr/sbin/sendmail -t \"", EMAIL, "\"")
    system(cmd)      
    

提交回复
热议问题