Jump to content

pop3 fun - imap_open sometimes works


thetxt

Recommended Posts

Hey! First off I would like to say that I resort to posting on a forum for help when I am at a complete loss...

 

I have been using the same script for almost a year to check pop3 mails for user accounts on my server. It hasnt worked well since I first wrote it.

Sometimes it connects and gets the mails fine but a lot of times it just hangs. It doesnt timeout or anything..it just hangs and the page keeps trying to load. Actually, if I want to use my site anymore, I have to restart the browser.

 

here is the code i use to connect:

 

$mbox_open = "{" . $server . ":110/pop3}INBOX"; 
$mbox = imap_open($mbox_open, $user, $password); 

 

...where $server = mail.mysite.com

 

My server is running php4.

 

Is there a better/faster way to connect?

If nothing else is there a way I can set it to timeout at least and retry?

 

Thank you all for your help

 

 

chris

Link to comment
Share on other sites

Sorry I've never even heard of this function until now.  Crazy how many cool functions are built into php.  Here's what I would do first in your situation.  Change the max execution time in your php.ini file to something reasonable that way you will get a timeout error instead of having to close your browser when this thing hangs.

 

Next try running the function without using the variables.  Like they are doing in some of the examples here: http://us2.php.net/manual/en/function.imap-open.php

Link to comment
Share on other sites

Thank you for your reply!

I have read the php manual on impa_open and found no help there =/

 

As you suggested, I hardcoded the server into the function. Unfortunately I still have the same issues. The username and password will have to be variables obviously.

 

Any and all suggestions are welcome. This is driving me insane!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.