Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Dear monks, i have written a small script to check my gmail inbox and report the latest 5 messages. What i cannot figure out i how to extract the cc field from the email header. Hope someone can tell me, thank you.
use Mail::IMAPClient; use IO::Socket::SSL; $sock = IO::Socket::SSL->new( PeerAddr => "imap.gmail.com", PeerPort => 993) or die $@; $client = Mail::IMAPClient->new( Socket => $sock, User => 'anyany@gmail.com', Password => '*****' ); $client->select("INBOX"); @messages = $client->messages; for($x=1;$x<=5;$x++){ $bs = pop(@messages); $from = $client->get_header($bs,"from"); $date = $client->get_header($bs,"date"); $subj = $client->get_header($bs,"subject"); print "From:$from\nDate:$date\nSubject:$subj\n\n"; } $client->logout();
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: read gmail and extract cc field -- Email::Simple
by Discipulus (Canon) on Jun 08, 2017 at 08:31 UTC | |
Re: read gmail and extract cc field
by hippo (Bishop) on Jun 08, 2017 at 08:24 UTC | |
by Anonymous Monk on Jun 08, 2017 at 08:59 UTC | |
by Corion (Patriarch) on Jun 08, 2017 at 09:03 UTC | |
by Anonymous Monk on Jun 08, 2017 at 09:16 UTC | |
by Corion (Patriarch) on Jun 08, 2017 at 09:18 UTC | |
| |
Re: read gmail and extract cc field
by thanos1983 (Parson) on Jun 08, 2017 at 08:24 UTC |
Back to
Seekers of Perl Wisdom