Retrieve mails using POP

0 views
Skip to first unread message

Dhaval Parikh

unread,
Nov 17, 2007, 10:50:35 AM11/17/07
to rubyonra...@googlegroups.com
Hello frnds

Is there a method of retrieving mails using POP? Pls send refrences for
the same.

Thanks

Dhaval Parikh
--
Posted via http://www.ruby-forum.com/.

Mohit Sindhwani

unread,
Nov 17, 2007, 11:11:42 AM11/17/07
to rubyonra...@googlegroups.com
Dhaval Parikh wrote:
> Hello frnds
>
> Is there a method of retrieving mails using POP? Pls send refrences for
> the same.
>
> Thanks
>
> Dhaval Parikh
>
Really, did you even try to do a search for ruby and POP on Google?? If
something is not working from the first hit that you get on Google when
you search for Ruby POP, will you tell us what errors you are getting.

I know I'm going to get flamed (again) about pointing this out, but
please at least do some basic level of search before asking the group here.

Anyway, I've done the work for you. Please look at:
http://www.ruby-doc.org/stdlib/libdoc/net/pop/rdoc/classes/Net/POP3.html

http://www.google.com.sg/search?hl=en&q=ruby+pop3+&btnG=Search&meta=

Cheers,
Mohit.
11/18/2007 | 12:11 AM.


Alain Ravet

unread,
Nov 17, 2007, 12:53:42 PM11/17/07
to rubyonra...@googlegroups.com
> > Is there a method of retrieving mails using POP? Pls send refrences for
> > the same.

If your mail is on Gmail (that uses ssl), the gmailer lib will make
your life easier :

gmailer :
http://rubyforge.org/projects/gmailutils
http://rubyforge.org/docman/view.php/869/194/README

Example :

require 'rubygems'
require 'gmailer'

def import
count=0
GMailer.connect('jobifier', 'password001') do |g|
g.messages(:label => "inbox") do |ml|
ml.each_msg do |conversation|
Email.create!(
:title => conversation.subject,
:text => conversation.body,
:sender => conversation.sender,
:sender_email => conversation.sender_email,
:reply_email => (conversation.reply_email.blank?) ?
conversation.sender_email : conversation.reply_email
)
count += 1
conversation.archive
end
end #connect
end
count
end

Alain Ravet

> http://www.ruby-doc.org/stdlib/libdoc/net/pop/rdoc/classes/Net/POP3.html
> http://www.google.com.sg/search?hl=en&q=ruby+pop3+&btnG=Search&meta=

Dhaval Parikh

unread,
Nov 19, 2007, 10:50:44 AM11/19/07
to rubyonra...@googlegroups.com
thanks a lot that was really useful
Reply all
Reply to author
Forward
0 new messages