sendmailR-package-valid code needed

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

sendmailR-package-valid code needed

veepsirtt
## Not run:
from <- sprintf("<sendmailR@
to <- "<[hidden email]>"
subject <- "Hello from R"
msg <- "It works!"
sendmail(from, to, subject, msg,
control=list(smtpServer="ASPMX.L.GOOGLE.COM"))
## End(Not run)

the above commands are provided in this document ie
http://cran.r-project.org/web/packages/sendmailR/sendmailR.pdf

it is not working.

hence give me a valid code for sending mails using gmail.com
thanks
veepsirtt

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: sendmailR-package-valid code needed

Chris Campbell
Hi veepsirtt

This code is fragmented due to the syntax of the example not being
parsed as intended to text. The source of \examples for sendmail.Rd is:

from <- sprintf("<sendmailR@%s>", Sys.info()[4])
to <- "< [hidden email]>"
subject <- "Hello from R"
msg <- "It works!"
sendmail(from, to, subject, msg,
         control=list(smtpServer="ASPMX.L.GOOGLE.COM"))


Cheers

Chris


Hadley Wickham, Creator of ggplot2 - teaching in the UK. 1st - 2nd
November 2010.
To book your seat please go to http://mango-solutions.com/news.html 

Chris Campbell

MANGOSOLUTIONS
T: +44 (0)1249 767700 Ext: 233
F: +44 (0)1249 767707
M: +44 (0)7967 028876
www.mango-solutions.com

Unit 2 Greenways Business Park
Bellinger Close
Chippenham
Wilts
SN15 1BN
UK

-----Original Message-----
From: [hidden email] [mailto:[hidden email]]
On Behalf Of Velappan Periasamy
Sent: 23 August 2010 11:45
To: [hidden email]
Subject: [R] sendmailR-package-valid code needed

## Not run:
from <- sprintf("<sendmailR@
to <- "<[hidden email]>"
subject <- "Hello from R"
msg <- "It works!"
sendmail(from, to, subject, msg,
control=list(smtpServer="ASPMX.L.GOOGLE.COM"))
## End(Not run)

the above commands are provided in this document ie
http://cran.r-project.org/web/packages/sendmailR/sendmailR.pdf

it is not working.

hence give me a valid code for sending mails using gmail.com
thanks
veepsirtt

______________________________________________
[hidden email] 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.
LEGAL NOTICE
This message is intended for the use o...{{dropped:9}}

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: sendmailR-package-valid code needed

veepsirtt
Hello Chris Campbell ,

I tried this for my email id it give me errors

> from <- sprintf("<sendmailR@%s>", Sys.info()[4])
> to <- "< [hidden email]>"
> subject <- "Hello from R"
> msg <- "It works!"
> sendmail(from, to, subject, msg,control=list(smtpServer="ASPMX.L.GOOGLE.COM"))

Error in waitFor(code) :
  SMTP Error: 5.1.1 The email account that you tried to reach does not
exist. Please try
Calls: sendmail -> smtpSubmitMail -> sendCmd -> waitFor

my email id is correct
please help me

with regards
veepsirtt

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: sendmailR-package-valid code needed

barry rowlingson
On Mon, Aug 23, 2010 at 3:55 PM, Velappan Periasamy <[hidden email]> wrote:

> Hello Chris Campbell ,
>
> I tried this for my email id it give me errors
>
>> from <- sprintf("<sendmailR@%s>", Sys.info()[4])
>> to <- "< [hidden email]>"
>> subject <- "Hello from R"
>> msg <- "It works!"
>> sendmail(from, to, subject, msg,control=list(smtpServer="ASPMX.L.GOOGLE.COM"))
>
> Error in waitFor(code) :
>  SMTP Error: 5.1.1 The email account that you tried to reach does not
> exist. Please try
> Calls: sendmail -> smtpSubmitMail -> sendCmd -> waitFor
>
> my email id is correct

 The sendmail function in the sendmailR package can't send email via a
server that uses SMTP-Authentication. Gmail's smtp server, which is
called smtp.gmail.com, relies on SMTP AUTH to make sure you are who
you say you are. The sendmail function doesn't know how to respond.

 It could be written to handle it, the outline of SMTP AUTH are here:

http://en.wikipedia.org/wiki/SMTP-AUTH

 and google's page detailing its SMTP service are here:

http://mail.google.com/support/bin/answer.py?hl=en&answer=13287
http://mail.google.com/support/bin/answer.py?hl=en&answer=78775

 and various other places.

 Short answer: no.

Barry

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: sendmailR-package-valid code needed

bbolker
Barry Rowlingson <b.rowlingson <at> lancaster.ac.uk> writes:

>
> On Mon, Aug 23, 2010 at 3:55 PM, Velappan Periasamy <veepsirtt <at> gmail.com>
wrote:
> > Hello Chris Campbell ,
> >

  I just posted my embryonic 'Rmail' package, which does a form
of SMTP authentication (maybe not the version you want), to
http://www.mathserv.mcmaster.ca/~bolker/R/src/contrib/Rmail_1.0.tar.gz

  You should be able to install it via

install.packages("Rmail",contriburl="http://www.math.mcmaster.ca/~bolker/R/src/contrib")

  (although not that it is a source package -- there's no compiled
code, though, so if necessary you can download the tarball and dig
the R source code out ...)

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: sendmailR-package-valid code needed

bbolker
  No, alas.  It would have been nice but I decided I didn't need it that
badly/need to spend time reinventing that many wheels. (It does do
mail-merge, though, which is what I developed it for in the first
place.)  It seemed to me that a more sensible solution would have been
to find a Perl or Python library/code fragment that knew the formats for
MIME attachments, but surprisingly (to me) I didn't easily discover
anything appropriate floating around on the web  ...
 

Frank Harrell wrote:

> Ben does yours create mime attachments?
> Thanks
> Frank
>
> Frank E Harrell Jr   Professor and Chairman        School of Medicine
>                      Department of Biostatistics   Vanderbilt University
>
> On Mon, 23 Aug 2010, Ben Bolker wrote:
>
>> Barry Rowlingson <b.rowlingson <at> lancaster.ac.uk> writes:
>>
>>>
>>> On Mon, Aug 23, 2010 at 3:55 PM, Velappan Periasamy <veepsirtt <at>
>>> gmail.com>
>> wrote:
>>>> Hello Chris Campbell ,
>>>>
>>
>>  I just posted my embryonic 'Rmail' package, which does a form
>> of SMTP authentication (maybe not the version you want), to
>> http://www.mathserv.mcmaster.ca/~bolker/R/src/contrib/Rmail_1.0.tar.gz
>>
>>  You should be able to install it via
>>
>> install.packages("Rmail",contriburl="http://www.math.mcmaster.ca/~bolker/R/src/contrib")
>>
>>
>>  (although not that it is a source package -- there's no compiled
>> code, though, so if necessary you can download the tarball and dig
>> the R source code out ...)
>>
>> ______________________________________________
>> [hidden email] 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.
>>

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: sendmailR-package-valid code needed

veepsirtt
I could not install Rmail Package .
I got the following errors.
Then how to do.please

 library("caTools")
> install.packages("Rmail",contriburl="http://www.math.mcmaster.ca/~bolker/R/src/contrib")

Warning: dependency ‘caTools’ is not available
trying URL 'http://www.math.mcmaster.ca/~bolker/R/src/contrib/Rmail_1.0.zip'
Error in download.file(url, destfile, method, mode = "wb", ...) :
  cannot open URL 'http://www.math.mcmaster.ca/~bolker/R/src/contrib/Rmail_1.0.zip'
In addition: Warning message:
In download.file(url, destfile, method, mode = "wb", ...) :
  cannot open: HTTP status was '404 Not Found'
Warning in download.packages(pkgs, destdir = tmpd, available = available,  :
  download of package 'Rmail' failed


With regards
veepsirtt
Reply | Threaded
Open this post in threaded view
|

Re: sendmailR-package-valid code needed

barry rowlingson
On Tue, Aug 24, 2010 at 7:18 AM, veepsirtt <[hidden email]> wrote:

>
> I could not install Rmail Package .
> I got the following errors.
> Then how to do.please
>
>  library("caTools")
>> install.packages("Rmail",contriburl="http://www.math.mcmaster.ca/~bolker/R/src/contrib")
>
> Warning: dependency ‘caTools’ is not available
> trying URL 'http://www.math.mcmaster.ca/~bolker/R/src/contrib/Rmail_1.0.zip'
> Error in download.file(url, destfile, method, mode = "wb", ...) :
>  cannot open URL
> 'http://www.math.mcmaster.ca/~bolker/R/src/contrib/Rmail_1.0.zip'
> In addition: Warning message:
> In download.file(url, destfile, method, mode = "wb", ...) :
>  cannot open: HTTP status was '404 Not Found'
> Warning in download.packages(pkgs, destdir = tmpd, available = available,  :
>  download of package 'Rmail' failed

 Unless Ben can provide a quick fix for this, you might be better off
taking his advice and using python - it comes with a full smtp
implementation that can easily send emails via gmail. Here it is in
about 12 lines of code, I've tried this and it works for me:

http://www.nixtutor.com/linux/send-mail-through-gmail-with-python/

 - just replace the username and password with yours and it should
work, assuming you have enabled POP and IMAP access in your gmail
settings, which seems to be a prerequisite for google's smtp access.
You can run python from R, exactly how may depend on your operating
system, using something like R's system() function.

 Here's an example that sends attachments with the email, but I've not
tried or tested this:

http://kutuma.blogspot.com/2007/08/sending-emails-via-gmail-with-python.html

Barry

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: sendmailR-package-valid code needed

bbolker
In reply to this post by veepsirtt
veepsirtt <veepsirtt <at> gmail.com> writes:

> Warning: dependency ‘caTools’ is not available

  I'm not quite sure why this is complaining when you supposedly
just loaded it ... do you really have it installed?

> trying URL 'http://www.math.mcmaster.ca/~bolker/R/src/contrib/Rmail_1.0.zip'
> Error in download.file(url, destfile, method, mode = "wb", ...) :
>   cannot open URL

  As I said, I've only made a source package available.  What happens
if you use the type="source" argument in install.packages() ?
In the meantime, I'm working on compiling a Windows binary.

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: sendmailR-package-valid code needed

bbolker
In reply to this post by veepsirtt
veepsirtt <veepsirtt <at> gmail.com> writes:

>
>
> I could not install Rmail Package .
> I got the following errors.
> Then how to do.please
>
>  library("caTools")
> >
install.packages("Rmail",contriburl="http://www.math.mcmaster.ca/~bolker/R/src/contrib")


try

install.packages("caTools")
install.packages("Rmail",repos="http://www.math.mcmaster.ca/~bolker/R")

  good luck

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: sendmailR-package-valid code needed

veepsirtt
This post has NOT been accepted by the mailing list yet.
How to use mail,mailR ,Rmail, sendmailR, sendEmail.R packages?
give me a valid example code to use under RStudio console.

thanks
veepsirtt