0

Currently, I use the following line to send emails with R.

system("curl --ssl-reqd smtp://smtp.test.com:587 --mail-from jan@test.com --mail-rcpt jan@test.com --upload-file email.txt --insecure -u user:password")

I would like to use the RCurl or Curl package to send this request natively from R. Is it possible to send requests using the smtp protocol with RCurl or Curl? I don't like to use the mailR package due to its RJava dependency. Thanks for your help!

Jan
  • 186
  • 8
  • Natively is maybe not the right word. From Outlook client, see this : https://stackoverflow.com/questions/26811679/sending-email-in-r-via-outlook ; there's a GMAIL client too : http://cran.univ-paris1.fr/web/packages/gmailr/index.html – Eugène Adell Mar 04 '18 at 22:18
  • Hi @EugèneAdell! Thanks for your fast reply. Unfortunately, I am looking for a solution that's independent of any provider and does not require any dependencies such as Outlook. – Jan Mar 05 '18 at 10:54
  • Why do you consider your curl command being not native enough ? – Eugène Adell Mar 05 '18 at 11:37
  • Because I would like to execute the command directly from R without creating the *email.txt* every time. Additionally, I would like to use the function on Windows and Linux without installing non-R dependencies every time. – Jan Mar 05 '18 at 11:42
  • You understand that you need anything which looks like a mail client, and usually, don't re-invent the wheel. Maybe should you consider that file.txt can be kept and archived for later debugging for example. It is not what you want, but relying on curl makes sense. – Eugène Adell Mar 05 '18 at 11:55

0 Answers0