Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.ruby > #4428

Email Parsing

From Robert Johns <piratej74@live.com>
Newsgroups comp.lang.ruby
Subject Email Parsing
Date 2011-05-12 15:28 -0500
Organization Service de news de lacave.net
Message-ID <fc0d26726bd7a41b4a6d7d590b6c0cb5@ruby-forum.com> (permalink)

Show all headers | View raw


How would I only pull links from the email's body and not the full
email.

require 'net/pop'
require 'rubygems'
require 'tmail'

username = ' '
pass = ' '

Net::POP3.enable_ssl(OpenSSL::SSL::VERIFY_NONE)
Net::POP3.start('pop.gmail.com', 995, username, pass) do |pop|
    if pop.mails.empty?
        puts "No mail"
        else
            pop.each_mail do |mail|
            email = TMail::Mail.parse(mail.pop)
            p email.body
            end
        end
     end


Thanks

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

Back to comp.lang.ruby | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Email Parsing Robert Johns <piratej74@live.com> - 2011-05-12 15:28 -0500
  Re: Email Parsing Brian Candler <b.candler@pobox.com> - 2011-05-12 15:39 -0500
  Re: Email Parsing Robert Johns <piratej74@live.com> - 2011-05-12 16:24 -0500
  Re: Email Parsing Ryan Davis <ryand-ruby@zenspider.com> - 2011-05-12 18:57 -0500
    Re: Email Parsing Phillip Gawlowski <cmdjackryan@googlemail.com> - 2011-05-12 19:48 -0500

csiph-web