Y
Yogi
Hi All,
I am trying to login to my gmail id using MAIL::IMAPClient modules
available in CPAN. I took sample code available (for my POC) but it
is not working. Here is the snippet for your reference:
use strict;
use warnings;
# Use CPAN modules to handle mails
use Mail::IMAPClient;
my ($MAILSERVER,$USER,$PW,$num) = ();
($MAILSERVER,$USER,$PW,$num) = ('pop.gmail.com:995/pop3/ssl',
'(e-mail address removed)',
'mypwd');
my $imap = Mail::IMAPClient->new;
$imap = Mail::IMAPClient->new(
Server => $MAILSERVER,
User => $USER,
Password=> $PW,
Clear => 5
) or die "Cannot connect to $MAILSERVER as $USER:
$@";
Getting Error as:
Cannot connect to pop.gmail.com:995/pop3 as myid: Unable to connect to
pop.gmail.com:995/pop3: IO::Socket::INET: Bad service '143' at test.pl
line 15.
Do I need to set any environment variable before using this module?
Any SSL socket need to be made?
This is the first time I am using this module and hence I am not very
sure if this usage is correct or not.
Regards
I am trying to login to my gmail id using MAIL::IMAPClient modules
available in CPAN. I took sample code available (for my POC) but it
is not working. Here is the snippet for your reference:
use strict;
use warnings;
# Use CPAN modules to handle mails
use Mail::IMAPClient;
my ($MAILSERVER,$USER,$PW,$num) = ();
($MAILSERVER,$USER,$PW,$num) = ('pop.gmail.com:995/pop3/ssl',
'(e-mail address removed)',
'mypwd');
my $imap = Mail::IMAPClient->new;
$imap = Mail::IMAPClient->new(
Server => $MAILSERVER,
User => $USER,
Password=> $PW,
Clear => 5
) or die "Cannot connect to $MAILSERVER as $USER:
$@";
Getting Error as:
Cannot connect to pop.gmail.com:995/pop3 as myid: Unable to connect to
pop.gmail.com:995/pop3: IO::Socket::INET: Bad service '143' at test.pl
line 15.
Do I need to set any environment variable before using this module?
Any SSL socket need to be made?
This is the first time I am using this module and hence I am not very
sure if this usage is correct or not.
Regards