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}",'[email protected]','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! Link to comment https://forums.phpfreaks.com/topic/244628-imap_open-is-returning-a-string/ 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. Link to comment https://forums.phpfreaks.com/topic/244628-imap_open-is-returning-a-string/#findComment-1256467 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.