Hello Guys,
First steps with Web Programming, I tried using the module Mail::POP3Client to check letters in an email account I have and download the messages from there. I noticed that explicitly setting the port number in constructing the $mail object would cause "$mail->Count" to return -1 which indicates a connection error:
you have -1 new Message(s)
Whereas setting the SSL connectivity to true instead would make the program work just fine... It is not immediately clear to me why -1 is returned in the first case, I have configured POP settings and support including the port numbers as per instructions from Gmail. An explanation of this behavior is what I am curious to find out about...

use strict; use warnings; use Mail::POP3Client; my $userName = 'name@gmail.com'; my $password = 'password'; my $mail = new Mail::POP3Client( USER =>$userName, PASSWORD=>$password, HOST =>"pop.gmail.com", #PORT=> 995, #returns -1, not working USESSL =>'true' #changes the port# to 995,working. ); #checking for messages: if($mail->Count){ print "you have @{[$mail->Count]} new Message(s)\n"; print "saving Message(s) to file\n"; open(FileHandle, '>',"gmailMails.txt")or die("$!\n"); for(my $index =1;$index<=$mail->Count;$index++){ print FileHandle $mail->HeadAndBody($index +); } close FileHandle; }

My other pending issue is with the module Mail::Mailer, since it is based on the 'sendmail' *nix program what alternatives are there for me on Win systems so that I can send emails through, I'm considering Mail::Sender, what do you advice me of?...


Excellence is an Endeavor of Persistence. Chance Favors a Prepared Mind.

In reply to Mail::POP3Client USESSL=> and PORT=> by biohisham

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.