I am using imap_open to get email from gmail so its work on local server but when itry on live server it shows error.
Warning: imap_open(): Couldn't open stream {imap.gmail.com}INBOX
$server = "{imap.gmail.com/imap/ssl}";
$username = "[email protected]";
$password = "mypass";
$conn = imap_open ( $server , $username , $password );
$mailboxes = imap_list( $conn, $server, "*" );
echo "<pre>";
print_r($mailboxes);
try this for $server