I have a scheduled R script running from a windows machine. After it finishes, I wish this script to automatically send an email with some log file attached. Using shell() with some other scripts may be possbile, but I was wondering if there is a better solution within R. thanks.
Have you looked into the sendmailR
package yet? It allows SMTP to submit a message and you could probably edit the function to allow an attachment. Then again, if its only one log file it might just be worth it to use shell()
as you mentioned.
I'm not aware of R functions or libraries to send email. Most people would either write a shell script or use system() to call an external mail sender.
Some sample code that uses the latter approach is in this mailing list post, but it uses the Unix/Linux mail command. It may be possible to script something similar for Windows, or you could install the Cygwin package on your machine.
Would you settle for a twitter message? You could use Rcurl to post an update to twitter, which can then be forwarded to your cell phone as a text, or to your email via the notification settings.
See here: http://www.sakana.fr/blog/2007/03/18/scripting-twitter-with-curl/