Search code examples
phpemailgoogle-apps-scriptgmailimap

PHP IMAP is not working after 30 May 2022


I have an application where I am retrieving the Gmail mail via IMAP but after the new policy of Google(30 May 2022), it's not working.

It's showing the error "imap_open(): Couldn't open stream {imap.gmail.com:993/imap/ssl}INBOX" Previously it's working fine. Can anyone help me with this? Thanks in advance.


Solution

  • You need to turn on 2-Step Verification and then use App passwords to generate a new password for your app.