Jmlover
6/1/2008 5:51:00 AM
On Jun 1, 2:23 am, Craig <cwilli...@easynewsletters.net> wrote:
> On May 31, 1:46 am, Jmlover <Jmlo...@gmail.com> wrote:
>
> > @pop = Net::POP3.new('pop.163.com')
> > @pop.start(@username, @password)
>
> > @pop.each_mail do |m|
> > # How can I get the subject of m?
> > # ~~~~~~~~~~~~~~~~
> > # By m.pop?
> > end
>
> > @pop.finish
>
> > By the way, can I only get the mail header? How?
>
> > Thank you!
>
> Here is one way.
>
> puts m.pop.scan(/Subject:(.+)$/)
>
> Cheers,
>
> Craig
Thank you for your reply!