How to parse mail in Ruby-Mail 2.3 like in TMail? -
given tmail seems have problems ruby 1.9.2 have tried use mail instead. in old code had
gmail = net::imap.new(gmail_host, gmail_port, gmail_ssl) gmail.login(gmail_user, gmail_pass) gmail.select('inbox') gmail.uid_search(["not","seen"]).each |message_id| tmail::mail.parse(gmail.uid_fetch(message_id, 'rfc822').first.attr['rfc822']) ....
how go implementing same in mail? i've tried
mail.read(gmail.uid_fetch(message_id, 'rfc822').first.attr['rfc822'])
, mail::mail.parse(gmail.uid_fetch(message_id, 'rfc822').first.attr['rfc822'])
thinking sort of drop-in replacement no avail.
yep, ran problem today.
here's solution used: saving attachments rails 3
in case, it'd be:
mail.new(gmail.uid_fetch(message_id, 'rfc822').first.attr['rfc822'])
Comments
Post a Comment