0

When I execute code bellow from command line it ask me for keyring password. After inputing pasword it send email.

email2 <- compose_email(body = md("Brawo"))

email2 %>%  smtp_send(    to = "xxx",    from = "xxx@gmail.com",    subject = "x" ,    credentials = creds_key("gmail6")  )

But when I execute it via Rscript it trows error as bellow

Error in b__file_set_keyring_pass(self, private, key, keyring) :
  Aborted setting keyring password
Calls: %>% ... b_file_keyring_unlock -> <Anonymous> -> b__file_set_keyring_pass
Execution halted

I want to execute this script in CRON so I can not manualy enter keyring password every time. Could You help me?

1 Answers1

0

I gave this error because keyring which I want to use was locked.

If I want to use keyring I need unlock it by using function keyring_unlock() from keyring package.

keyring_unlock(password= "your keyring password")

In this configuration you will unlock default keyring.