Jump to content

imap_open() is returning a string


pstephan1187

Recommended Posts

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!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.