pstephan1187 Posted August 12, 2011 Share Posted August 12, 2011 I am trying to connect to a mail server via imap_open(). It is supposed to return a resource Identifier, but whether it fails or succeeds, i get a string. My code: <?php ini_set('display_errors', 1); $mbox = imap_open("{mydomain/notls}",'user@mysitemail.net','pass')."<br /><br />"; var_dump($mbox); imap_close($mbox); ?> This returns: string(26) "Resource id #2 " Warning: imap_close() expects parameter 1 to be resource, string given in /var/www/vhosts/mysitemail.net/httpdocs/test.php on line 5 I can't seem to find anything on the topic. How can I either get the resource or the boolean? If I try to get the imap headers with $mbox, it fails saying that $mbox is a string and not a resource. AGH! Quote Link to comment Share on other sites More sharing options...
pstephan1187 Posted August 12, 2011 Author Share Posted August 12, 2011 Ever bang your head on a wall for hours only to find out you're missing a semicolon or something simple is the culprit to your problem? It might help if I removed the ."<br /><br />" from the end of the imap_open line. DUH! Sorry to waste your server space phpfreaks. Quote Link to comment 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.