Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^3: Mail::POP3Client email server to use

by socketdave (Curate)
on Jul 15, 2005 at 13:03 UTC ( [id://475203]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Mail::POP3Client email server to use
in thread Mail::POP3Client email server to use

First, you should probably edit your code to remove the username and pass (unless this is an account set up specifically for testing this script).

It seems to me that you should move your initialization of your pop object to outside the until loop:
use Mail::POP3Client; $pop = new Mail::POP3Client( USER => "username", PASSWORD => "password", HOST => "server.domain.tld", AUTH_MODE => "PASS", DEBUG => 1 ); $MailState = $pop->State; if ( $MailState eq 'AUTHORIZATION' ) { die "\n\nBad user name or password!\n"; } elsif ( $MailState eq 'DEAD' ) { die "\n\nMail server unreachable or unavailable!\n"; } $continue = "false"; until ( $continue = "true" ) { ...


This won't get your whole script working, but with this change it does connect and check my messages.

Hope this helps...

Replies are listed 'Best First'.
Re^4: Mail::POP3Client email server to use
by skx (Parson) on Jul 15, 2005 at 13:25 UTC
      What do you mean? I just want that variable to be set to something and then change it to something else if I find what I'm looking for. What should that code look like instead? Thanks, Austin
Re^4: Mail::POP3Client email server to use
by Anonymous Monk on Jul 15, 2005 at 16:29 UTC
    Thanks again for the suggestions. I changed the loop, but I still can't connect. That email address is set up specifically for this task. Has anyone gotten this code to work with a gmail account? What opeating system are you using? Is anyone able to read my particular email (using the username and password I wrote above) using this code? Also, I added the DEBUG => 1 to the code and it didn't do anything different. What is supposed to happen? I have a feeling something is going wrong with the connection but I'm not sure how to see what. Thanks again, Austin
      I think what you really want to do is connect, grab all of the messages, determine if the message you're looking for is there and do something based on that. Is this correct? Do you want the script to continually reconnect and retry if it doesn't find what it's looking for? If so, do you want to to keep trying after it's foud it's first match?
        Yeah that's what I want to do. Fortunately, I figured out that I need to set USESSL=>1 and download some additional modules (IO::Socket::SSL, Net_SSLeay, OpenSSL) to get this working. Thanks for all the help! Austin

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (3)
As of 2024-04-25 07:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found