Skip to content Skip to sidebar Skip to footer

Open Email By Php Using Imap Giving Me This Error Message: Imap_open() [function.imap-open]: Couldn't Open Stream {imap.gmail.com:993/imap/ssl}inbox

I am trying to open the email messages by php using imap method but it give me an error Couldn't open stream {imap.gmail.com:993/imap/ssl}INBOX and this is my code $hostname = '{im

Solution 1:

Try this:

$hostname = '{imap.gmail.com:993/imap/ssl/novalidate-cert}INBOX';
$inbox = imap_open($hostname,$username ,$password) ordie('Cannot connect to Gmail: '        imap_last_error());

Solution 2:

{imap.gmail.com:993/imap/ssl}INBOX

working for me but you have to enable 'Access for less secure apps' on account security or you can try live email account

Post a Comment for "Open Email By Php Using Imap Giving Me This Error Message: Imap_open() [function.imap-open]: Couldn't Open Stream {imap.gmail.com:993/imap/ssl}inbox"