From: Charles Gray Date: 2008-09-04T20:51:46+09:00 Subject: Re: IMAP, Gmail & reading the body of the message On Thu, 2008-09-04 at 17:07 +0900, Luis Parravicini wrote: > On Wed, Sep 3, 2008 at 12:28 PM, Azalar --- wrote: > > All of the examples I have seen while Googling for this show you how to > > get headers but none of the sites showed how to read the body of the > > message. > > All the messages > > Could someone explain how I can read my GMail messages via Ruby and IMAP > > please? > > Hi > > Use Net::IMAP.fetch ( > http://www.ruby-doc.org/stdlib/libdoc/net/imap/rdoc/classes/Net/IMAP.html#M001284 > ) and using something like 'BODY[TEXT]' as the attributes argument to > fetch. > For example: > > body = imap.fetch(msg.seqno, 'BODY[TEXT]') > > Sometimes I use TMail ( http://tmail.rubyforge.org/ ) to parse the > mail after getting it. > > gmail is pop3 with ssl encoding.