Reputation: 589
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);
Upvotes: 0
Views: 1428
Reputation: 11
$server = "{imap.gmail.com:993/imap/ssl/novalidate-cert}INBOX";
$user = "yourusername"; //do not include @gmail.com nor googlemail.com
$passwd = "yourpassword";
$mbox = imap_open($server,$user,$passwd) or die("Could not open Mailbox - try again later!");
Upvotes: 1