Gmailr without selecting a pre-authorised account in R

后端 未结 2 692
醉酒成梦
醉酒成梦 2020-12-20 23:19

In the R script, when I try to send the email with the following codes below. It asks that the gmailr package is requesting access to your Google account. Select a pre-autho

2条回答
  •  天涯浪人
    2020-12-20 23:41

    Just add the "from e-mail address" with gm_auth(email = "email1@gmail.com")

    library(gmailr)
    gm_auth_configure(path="C:/Users/Google Drive/email.json")
    gm_auth(email = "email1@gmail.com")
    
    my_email_message <- gm_mime() %>%
      gm_to("email1@gmail.com") %>%
      gm_from("email1@gmail.com") %>%
      gm_subject("My test message") 
    
    gm_send_message(my_email_message)```
    

提交回复
热议问题