From: Jen Date: 2010-09-26T17:09:33+09:00 Subject: Re: Problem connecting to hotmail using the pony gem (now using hotmailer) Hi, I found the 'hotmailer' gem, but when I try to use it I get an error saying the "login" method is unknown. I've looked at the gem code and it looks like I'm calling the correct method. Can someone please tell me what I'm doing wrong :( Here is the code I used to test the gem: require "rubygems" require "hotmailer" #create object and login jen = Hotmailer.new("my_email_address@hotmail.co.uk","my_password") puts jen.inspect jen.login() Here is the error I receive: /var/lib/gems/1.8/gems/hotmailer-1.0.1/lib/hotmailer.rb:24:in `login': undefined method `login=' for nil:NilClass (NoMethodError) from hotmailertest.rb:6 The README for the hotmailer gem is located here: http://rubydoc.info/gems/hotmailer/1.0.1/frames Thanks in advance for any suggestions, Jen. On 08/09/10 18:47, Alex Stahl wrote: > Hi Jen - Not too long ago I was involved w/ some code to do exactly this > - connect to hotmail. Can't say that I know the solution that my > colleague developed before he left, but I do know that hotmail uses a > fair amount of ajax (or whatever M$ calls it). That implies that it's > not as simple as sending an http request - there's some processing on > the login page that needs to happen first. > > My next step in inheriting the work is to try to figure out how to parse > the javascript from ruby to send the proper request. Looking at either > the harmony or rkelly gems to do so. They might be suitable for what > you're trying as well. > > -Alex > > On Tue, 2010-09-07 at 23:46 -0500, Jen wrote: > >> Hello, >> >> I have only just started seariously playing with Ruby. >> I have a script that needs to e-mail data it has gathered to a specific >> address. I want to use my hotmail account to send out the e-mail until I >> sort my own mail server, but can't connect using pony. >> >> my code is: >> >> Pony.mail(:to => "Myaddress@hotmail.co.uk", :from => >> "Myaddress@hotmail.co.uk", :via => :smtp, >> :smtp => {:host => "smtp.live.com", :port => "25", :tls => true, :user >> => "fMyUserName", >> :password => "MyPassword", :auth => :plain, >> #:login, :cram_md5, >> :domain => "localhost:chicken"}, :subject => "Optelec tweets", :body => >> "This is a test") >> >> I am trying to send the email to myself to check if I can receive it. >> Does it matter that the 'from' and 'to' addresses are the same. >> When I run this (with the correct username and password) the connection >> times out. >> Uncommenting the commented line above gives errors when running, and I >> think this line is actually gmail specific. >> >> If there is a better way of doing this please let me know. >> >> Regards, >> Jen. >> > > > > >