waverider Posted June 10, 2006 Share Posted June 10, 2006 Hello,Having trouble logging on to hosting company's shared server using IMAP. The webmail program I am using in the root of my site won't log on and I can't log on with a testing script either. They insist the extensions are installed correctly as HORDE and Squirrelmail work OK.PHP v 5.1.4 IMAP c-client version 2004I have used the test script below loaded into the root of the domain and get the message:Warning: imap_open() [function.imap-open]: Couldn't open stream {localhost:143/imap/notls}INBOX in /home/*****/public_html/imap_test2.php on line 10Warning: imap_check(): supplied argument is not a valid imap resource in /home/*****/public_html/imap_test2.php on line 13............Is there something wrong with the script, am I unable to run it from the root of my domain, or is there something else such as the server not allowing this?<HTML><HEAD><TITLE>imap_check</TITLE></HEAD><BODY><? //check for new messages $mailbox = imap_open("{localhost/imap:143}INBOX", "myname@mydomain.com","mypassword"); // Check messages $check = imap_check($mailbox); print("<PRE>"); print("Date most recent message : " . $check->Date); print("<BR>"); print("Connection type : " . $check->Driver); print("<BR>"); print("Name of the mailbox : " . $check->Mailbox); print("<BR>"); print("Number of messages : " . $check->Nmsgs); print("<BR>"); print("Number of recent messages : " . $check->Recent); print("<BR>"); print("</PRE>"); // show headers for messages $index=1; $header = imap_header($mailbox, $index); print("<PRE>"); print("Header Date : " . $header->Date . "<BR>"); print("Header To : " . $header->to) . "<BR>"; print("Header From : " . $header->From . "<BR>"); print("Header cc : " . $header->cc . "<BR>"); print("Header ReplyTo : " . $header->ReplyTo . "<BR>"); print("Header Subject : " . $header->Subject . "<BR></PRE>"); print("<PRE>"); print(imap_body($mailbox,$index)); print("</PRE><HR>"); imap_close($mailbox);?></BODY></HTML> Quote Link to comment https://forums.phpfreaks.com/topic/11644-php-and-imap-extension/ Share on other sites More sharing options...
waverider Posted June 10, 2006 Author Share Posted June 10, 2006 Any ideas? PleaseI have now added:or die("can't connect: ".imap_last_error());to the imap_open() part of the script and now get the message:Warning: imap_open() [function.imap-open]: Couldn't open stream {localhost/imap:143}INBOX in /home/*****/public_html/imap_test2.php on line 9can't connect: Can not authenticate to IMAP server: AUTHENTICATE LOGIN failed Quote Link to comment https://forums.phpfreaks.com/topic/11644-php-and-imap-extension/#findComment-44146 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.