Okay, this code 'was' working perfectly and then I started playing around with it in order to let others connect to their e-mails and as you do ran into a few open stream errors along the way due to various typos and such.
Since doing this, all of a sudden I can't connect to my e-mail at all? A short while back I was using the exact same connection code and then browsing my inbox.
I always get the "Warning: imap_open() [function.imap-open]: Couldn't open stream" error.
This is strange as I'm using the exact same code as before, but since bumping into errors I can't connect whatsoever now. It also takes ages to respond.
Here is the code:
$mailbox = imap_open('{mail.artisancodesmith.com:143/notls}INBOX', 'admin@artisancodesmith.com', 'PASSWORD');
if ($mailbox) {
$response = "MAIL MENU:<br>
inbox: View your inbox.<br>
compose: Compose an e-mail.<br>
setup: Set your e-mail account's settings.";
$next = "iorcmail";
}
NOTE: The PHP page is connecting to the e-mail on the same server.
UPDATE: If I replace "mail.artisancodesmith.com" with "localhost" it works again! I would preferably like to use my actual IMAP host - I'll see if it works again some time in the future I guess. Thanks to all who helped. :)
Please use the below code to connect successfully,
I ran into this problem and here is how I solved it;
after this, above code works for me....
I have tried this an works perfectly fine for me
maybe are you behind a proxy? if so, I guess you need to auth against it...