phpimap-open

Using imap_search with a Godaddy hosted email account?


I'm having issues with using imap_search() using a Godaddy hosted email account.

I have created a script that connects to 3 mail boxes using PHP and the imap_open() and imap_search() functions before looping through all the emails and retracting the specific information that I need.

It works fine with 2 other accounts, 1 hosted with gmail and the other self hosted. With the Godaddy account I don't have hosting with them they only host our emails and our website is hosted elsewhere.

I can connect fine to the mail server using imap_open() without errors, however when I use imap_search($inbox,'UNSEEN') it doesn't return any emails, I've tried changing 'UNSEEN' to 'ALL' but it is still not retrieving any emails.

The imap_open host value im using is {imap.secureserver.net:993/imap/ssl}INBOX

I don't know if anyone has had any issues with this before and while I wait for a response from GoDaddy, I know that users here are usually a lot quicker at responding and more informative so I'm asking the community here.

If I run echo commands after the imap_open() function I can see this on screen so I know it is getting that far in the script, it is just returning a blank array of emails for the imap_search() request.


Solution

  • I have had a response from GoDaddy with the following information in case anybody else finds themselves in the same boat as me.

    Thank you for contacting Online Support. Our IMAP servers do not allow connections from external servers. This is prevented within the mail server security settings and firewalls. We apologize for any inconvenience however, these settings will not modified to support imap_search(). We appreciate your understanding regarding this matter.

    This is quite frustrating, however at least I have an answer. I will have to move my emails over to Google Apps or similar to get these to work with imap_open() / imap_search() on my server.