Hello frnds, I am trying to makd a perl propram by that i can retrieve my email from a server that requires SSL authentication. I used Net::POP3 and I tried all the different types of logging in such as auth(..), login(..), which are sub routines defined in Net::POP3. But not working plz tell me any method or perl module by that i can retrive mail. Thanks
You can use the following code Code: use warnings; use strict; use Mail::POP3Client; use lib "/home/murugaperumal/.perl_m/share/perl/5.8.8/" ; use IO::Socket::SSL; use CGI qw(:standard); my $cgi = new CGI; my $LOG ; open $LOG , ">>filename" ; my $username = 'username@gmail.com'; my $password = '********' ; chomp($password); my $mailhost = 'pop.gmail.com'; my $port = '995'; $cgi->header(); my $pop = new Mail::POP3Client( USER => $username, PASSWORD => $password, HOST => $mailhost, PORT => $port, USESSL => 'true', DEBUG => 0, ); if (($pop->Count()) < 1) { exit; } print $pop->Count() . " messages found!:$!\n"; for(my $i = 1; $i <= $pop->Count(); $i++) { foreach($pop->Head($i)) { /^(From|Subject|Email):\s+/i && print $_, "\n"; } $pop->BodyToFile($LOG,$i); } $pop->Close(); exit;