Category: E-Mail Programs
Author/Contact Info Hubert
Description: First of all, I have to confess that I am a newbie, and this is one of my first script in perl. And also I must tell that my English isn't very good, so I hope that you will be understanding.

What does it do?

When we put information about login, pass and pop3 server (in source) and than run script we will see today's date and how many post we have in own account e-mail.


#!/usr/bin/perl
use warnings;
use strict;
use Net::POP3;
        
my $time = scalar localtime;
my $pop3 = "pop3.poczta.onet.pl";
my $login = "haptor\@op.pl";
my $pass = "*********";

my $pop = Net::POP3->new($pop3);
#my $smtp = Net::SMTP->new($ssmtp);
    
my $res = $pop->login($login, $pass);
if ($res eq "undef"){
print "Couldn't connect $!\n";
} else {
print "On $time e-mail status inbox: $res post \n";
}   

$pop->quit();

2005-12-03 Retitled by Arunbear

Replies are listed 'Best First'.
Re: Get number of items in email account via POP3
by w3b (Beadle) on Dec 03, 2005 at 13:29 UTC
    Fellow Monks, I commited a great sin, the above code contribute is of my creation but I have forgotten to login into perlmonks. And what a shame! I did not set up a topic :( So if there is a forgiving god around here that would kindly edit this contribute and set this topic "Check how many post you have". I fell very bad about it. What a way to start my path of enlightment :(
      Hey, don't worry. You remembered to use strict, use warnings, use CPAN, and hide your password, and those are the kinds of things we care more about :-). Welcome to the monastery!
        Thank you very much, i think that know my scripts will be more profesional^^ and faster...^^ thank you