Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

How to take subject in Net::Imap::simple 'get'

by Matt™ (Acolyte)
on Jan 22, 2013 at 13:54 UTC ( #1014661=perlquestion: print w/ replies, xml ) Need Help??
Matt™ has asked for the wisdom of the Perl Monks concerning the following question:

Hello Monks, I am taking E-mails from IMAP using the above module. How can I get the subject line of E-mails when I am using $imap->get to get the messages...?

Comment on How to take subject in Net::Imap::simple 'get'
Download Code
Replies are listed 'Best First'.
Re: How to take subject in Net::Imap::simple 'get'
by Corion (Pope) on Jan 22, 2013 at 13:55 UTC

    The module's documentation in Net::IMAP::Simple has a code snippet that claims to do Just That. What problems did you encounter when reading the documentation and how could it be made more clear in the SYNOPSIS section of the documentation that the snippet prints out the subject's of all the messages in the INBOX?

      Thx Corion, I am using this module for the first time. Here what I am trying to do is looping an $imap->get, so I want to get the subject also(with messsges)(now only getting messages). & i dont want to print just all the subjects in Inbox. I want the other scenario. Is there a way to get the subject also witj messages when using the $imap->get ?

        Have you looked at what ->get returns? If you are not familiar with the format of (MIME formatted) emails, I suggest you either follow the example of using Email::Simple for single messages or familiarize yourself with the "wire format" of mail messages. Most likely, the first or second header line will match ^Subject:. I still recommend a module that does the heavy lifting of decoding header lines for you.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1014661]
Approved by herveus
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (5)
As of 2015-10-10 19:45 GMT
Find Nodes?
    Voting Booth?

    Does Humor Belong in Programming?

    Results (257 votes), past polls