Hi, Has anyone used R to send out an email via an SMTP server? I run R from a script and would like to be able to send out an email from there also. I could shell out to an email program, but was hoping maybe someone had a package for R or a smooth way to do it. Thanks, Josh [[alternative HTML version deleted]]
Try SiteSearch("blat") from within R for examples using blat. Please read the posting guide and, in particular, give your platform next time. On Nov 4, 2007 8:45 PM, Josh Kalish <joshkalish at gmail.com> wrote:> Hi, > > > > Has anyone used R to send out an email via an SMTP server? I run R from a > script and would like to be able to send out an email from there also. I > could shell out to an email program, but was hoping maybe someone had a > package for R or a smooth way to do it. > > > > Thanks, > > > > Josh > > > [[alternative HTML version deleted]] > > ______________________________________________ > 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. >
On 05-Nov-07 01:45:50, Josh Kalish wrote:> Hi, > Has anyone used R to send out an email via an SMTP server? > I run R from a script and would like to be able to send out > an email from there also. I could shell out to an email program, > but was hoping maybe someone had a package for R or a smooth way > to do it. > > Thanks, > JoshThere is a thread in R-help starting on 10 May 1965 at https://www.stat.math.ethz.ch/pipermail/r-help/2005-May/071200.html "[R] Does R have a command for sending emails?" (Fernando Saldanha) Specific suggestions for specially-written R functions which can do this are at https://www.stat.math.ethz.ch/pipermail/r-help/2005-May/071212.html https://www.stat.math.ethz.ch/pipermail/r-help/2005-May/071233.html https://www.stat.math.ethz.ch/pipermail/r-help/2005-May/071235.html See also: https://www.stat.math.ethz.ch/pipermail/r-help/2005-May/071245.html https://www.stat.math.ethz.ch/pipermail/r-help/2005-May/071287.html https://www.stat.math.ethz.ch/pipermail/r-help/2005-May/071297.html Best wishes, Ted. -------------------------------------------------------------------- E-Mail: (Ted Harding) <Ted.Harding at manchester.ac.uk> Fax-to-email: +44 (0)870 094 0861 Date: 05-Nov-07 Time: 02:24:05 ------------------------------ XFMail ------------------------------
On Nov 4, 2007, at 9:24 PM, (Ted Harding) wrote:> On 05-Nov-07 01:45:50, Josh Kalish wrote: >> Hi, >> Has anyone used R to send out an email via an SMTP server? >> I run R from a script and would like to be able to send out >> an email from there also. I could shell out to an email program, >> but was hoping maybe someone had a package for R or a smooth way >> to do it. >> >> Thanks, >> Josh > > There is a thread in R-help starting on 10 May 1965 at >I usually say that R is one step ahead... it looks like the scale has just changed to 30 years or so... :-) b> https://www.stat.math.ethz.ch/pipermail/r-help/2005-May/071200.html > > "[R] Does R have a command for sending emails?" > (Fernando Saldanha) > > Specific suggestions for specially-written R functions which > can do this are at > > https://www.stat.math.ethz.ch/pipermail/r-help/2005-May/071212.html > > https://www.stat.math.ethz.ch/pipermail/r-help/2005-May/071233.html > > https://www.stat.math.ethz.ch/pipermail/r-help/2005-May/071235.html > > See also: > > https://www.stat.math.ethz.ch/pipermail/r-help/2005-May/071245.html > > https://www.stat.math.ethz.ch/pipermail/r-help/2005-May/071287.html > > https://www.stat.math.ethz.ch/pipermail/r-help/2005-May/071297.html > > Best wishes, > Ted. > > -------------------------------------------------------------------- > E-Mail: (Ted Harding) <Ted.Harding at manchester.ac.uk> > Fax-to-email: +44 (0)870 094 0861 > Date: 05-Nov-07 Time: 02:24:05 > ------------------------------ XFMail ------------------------------ > > ______________________________________________ > 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.
Josh Kalish wrote:> > Hi, > > > > Has anyone used R to send out an email via an SMTP server? I run R from a > script and would like to be able to send out an email from there also. I > could shell out to an email program, but was hoping maybe someone had a > package for R or a smooth way to do it. > > >I have a solution that seems to be 'better' (at least more self-contained) than the blat solution ... I've posted code at http://www.zoo.ufl.edu/bolker/Rmail.R I'm not sure about security issues -- it does allow a password to be sent, but I don't think it does anything with TLS/SSL etc -- at some point it stops making sense to keep re-inventing the wheel and interfacing to an outside package makes more sense Ben -- View this message in context: http://www.nabble.com/Sending-E-Mail-from-R-tf4749238.html#a13596138 Sent from the R help mailing list archive at Nabble.com.
Josh Kalish <joshkalish at gmail.com> wrote:> Has anyone used R to send out an email via an SMTP server?If your system is Unix or Linux and you use a system call to "mail", you might be interested to know that "uuencode" is a good way to include attachments. Create a temp file containing your body text, then append the output of "uuencode" to the end of it. Here's a piece of code: temp <- tempfile("Smail.") cat(text, file=temp, sep="\n") for (i in seq(along=attach)) system(paste("uuencode", attach[i], name[i], ">>", temp)) recip <- paste(recip, collapse=" ") system(paste("mail -s '", subject, "' ", recip, "<", temp, sep=""), TRUE) unlink(temp) -- David Brahm (brahm at alum.mit.edu)