Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Get number of items in email account via POP3

by Anonymous Monk
on Dec 03, 2005 at 13:17 UTC ( [id://513799]=sourcecode: print w/replies, xml ) Need Help??
Category: E-Mail Programs
Author/Contact Info Name: 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 nderstanding. 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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: sourcecode [id://513799]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (4)
As of 2024-04-19 03:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found