Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP imap_open() => [AUTHENTICATIONFAILED] for imap.gmail.com

It's already several days that we have started experience issues with imap_open function when try to connect to imap.gmail.com it returns:

Can not authenticate to IMAP server: [AUTHENTICATIONFAILED] Invalid credentials (Failure)

Here is the sample of the code that I try to run:

imap_open("{imap.gmail.com:993/imap/ssl}INBOX", username, password, NULL, 1);

Can this be an issue with the versions of PHP/Open SSL? If yes how can I solve it?

like image 656
Jason Clark Avatar asked Jul 02 '15 13:07

Jason Clark


1 Answers

There are two possible reasons:

1-Credentials are incorrect.

2-Gmail do not authorize imap for unrecognized web apps, you should enable this fact here gmail enable less secure apps

like image 130
Kassav' Avatar answered Nov 10 '22 21:11

Kassav'