[R] Email out of R (code)

Bos, Roger roger.bos at rothschild.com
Thu May 19 21:52:38 CEST 2011


I took a look at sendmailR when I was trying to figure out how to send
email a few years ago.  I ended up using my SQL Server dbmail facility,
which I can easily access from R using the RODBC package.  In case my
scenario applies to anyone else, I will paste the simple function I
wrote to serve as an example to anyone else who may want to do the same
thing:


"email" <- function(to, subject, msg, texttype='TEXT', imp='NORMAL',
profileName='Roger Bos') {
    go <- try(sqlQuery(xf, "EXECUTE msdb..sp_send_dbmail          
	                 @profile_name  = '" %+% profileName %+% "',
                  @recipients    = '" %+% to %+% "',
	                 @body          = '" %+% msg %+% "',
	                 @subject       = '" %+% subject %+% "',
	                 @query         = '',
                  @body_format   = " %+% texttype %+% ",
                  @importance    = '" %+% imp %+% "',
                  @attach_query_result_as_file = 0"))
}
 

-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org]
On Behalf Of Daniel Malter
Sent: Thursday, May 19, 2011 2:04 PM
To: r-help at r-project.org
Subject: Re: [R] Email out of R (code)

As I (thought I) understood from the sendmailR manual, the package does
currently not support server authentication, or does it?

Daniel 

--
View this message in context:
http://r.789695.n4.nabble.com/Email-out-of-R-code-tp3530671p3536512.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
***************************************************************

This message is for the named person's use only. It may\...{{dropped:20}}



More information about the R-help mailing list