php – $imapPath = ‘{imap.gmail.com:993/imap/ssl/novalidate-cert}INBOX’; and getting error like: Can’t connect to imap.gmail.com,995: Network is unreachable

Question

I have gmail connection issue using below code :

$imapPath=”{imap.gmail.com:993/imap/ssl/novalidate-cert}INBOX”;
$username=”example@gmail.com”;
$password = ‘password;

// try to connect
$inbox = imap_open($imapPath,$username,$password) or die(‘Cannot connect to Gmail: ‘ . imap_last_error());

Getting Error like below:

Cannot connect to Gmail: Can’t connect to imap.gmail.com,993: Network is unreachable

Tried below options :

  1. I’ve allowed access for less secure apps on the Gmail account
  2. Tried accounts.google.com/b/0/DisplayUnlockCaptcha
  3. Not enabled firewall on server so firewall issue not exists
  4. Enabled imap and pop from gmail setting
0
Heena 4 days 2021-09-13T01:43:09-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse