Do you have the mailR package installed? Do you get an error when running library(mailR)? It seems like R can't find the send.mail() function which suggests you haven't loaded the package namespace.
I use the {gmailr} package for sending automated emails from a Gmail account, and it works very well for me. So I can suggest that package from personal experience.
However, when I ran following code, I did get this error. Any idea why this happens?
use_secret_file("test3.json")
Warning message for above code:
"Use gm_auth_configure() to configure your own OAuth app. That will
dictate the app used when gm_auth() is called implicitly or explicitly to
obtain an OAuth2 token."
gm_auth_configure(path = "json stored at working directory and the path given here/id name.json")
No message on the console window and did not direct to the browser either.
test_email <- gm_mime(
To= c("receipent1@gmail.com","receipent2@gmail.com"),
From = "sender@gmail.com",
subject="Hello World!",
body="Can you hear me from R?")
send_message(test_email)
The ERROR message as follows:
Error: Can't get Google credentials.
Are you running gmailr in a non-interactive session? Consider:
Call gm_auth() directly with all necessary specifics.