WWW::Mailinator - Perl extension for grabbing messages from mailinator.net
WWW::Mailinator accesses 'your' mailinator.net mailbox and downloads the message(s).
WWW::Mailinator
use WWW::Mailinator; my $mailbox = WWW::Mailinator->new(); $mailbox->login('b10m'); if($mailbox->count) { foreach my $email ($mailbox->messages) { print $email->{from}.": ".$email->{subject}."\n"; print $mailbox->retrieve($email->{num})."\n\n"; } }
new creates a new WWW::Mailinator object. It takes no options.
new
login seems like a strange word for this action, for there is no password needed. Yet in spite of a better name, here it is. The only thing required is a username of the mailbox you want to check.
login
After 'logging in', you can access the count, messages, and retrieve routines.
count
messages
retrieve
count will return the amount of messages found for the user that logged in.
messages returns an array of all the messages found, except for the body of the email. From, Subject, URL, and Num(ber) can be accessed.
$mailbox->login('dude'); foreach my $email ($mailbox->messages) { printf("%03i <%s>: %s\n\t%s\n\n", $email->{num}, $email->{from}, $email->{subject}, $email->{url}); }
retrieve takes one argument, the mail number, and returns the corresponding email.
LWP::Simple, HTML::TableExtract, http://www.mailinator.net/
M. Blom, <b10m@perlmonk.org>
Copyright (C) 2004,2005 by M. Blom
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install WWW::Mailinator, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WWW::Mailinator
CPAN shell
perl -MCPAN -e shell install WWW::Mailinator
For more information on module installation, please visit the detailed CPAN module installation guide.