[R] eMail results out of R

Stéphane Dray dray at biomserv.univ-lyon1.fr
Thu Jul 12 18:10:46 CEST 2007


Here is a small function that I used on Debian. It requires exim4 :

send.mail<-function(addr='dray at biomserv.univ-lyon1.fr',subject='A 
message from R',
                    text=paste("I have finished to work 
",Sys.time(),coll="")){
    # send an email
    # it requires the reconfiguration of exim4
    # you have to connect as root and
    # then type dpkg-reconfigure exim4config
   
    mail.cmd<-paste("mail ",
                    "-s \"",subject,"\" ",
                    addr,
                    " << EOT &\n",
                    text,"\n",
                    "EOT",
                    sep="",collapse="")
     system(mail.cmd,intern=FALSE)
  }

Cheers,

Romain Francois wrote:
> Hi,
>
> There is a paper in the April 2007 issue of R News that might be of help 
> here.
> http://##cran mirror##/doc/Rnews/Rnews_2007-1.pdf
>
> Romain
>
> Duncan Murdoch wrote:
>   
>> On 7/12/2007 9:52 AM, thomas.schwander at mvv.de wrote:
>>   
>>     
>>> Hi everyone,
>>>
>>> I did my homework and read the posting guideline :-)
>>>
>>> I want to eMail the results of a computing automatically. So I get the results (the parameters of a garch process) and I want to eMail them to another person. How can I do that?
>>>     
>>>       
>> This will depend on the system you're using.  If the command "emailit" 
>> would work from the command line on your system, then
>>
>> system("emailit")
>>
>> should work from within R.  Writing that command is the hard part, of 
>> course.
>>
>> Duncan Murdoch
>>   
>>     


-- 
Stéphane DRAY (dray at biomserv.univ-lyon1.fr )
Laboratoire BBE-CNRS-UMR-5558, Univ. C. Bernard - Lyon I
43, Bd du 11 Novembre 1918, 69622 Villeurbanne Cedex, France
Tel: 33 4 72 43 27 57       Fax: 33 4 72 43 13 88
http://biomserv.univ-lyon1.fr/~dray/



More information about the R-help mailing list