1

Google has turned off access to gmail from less secure apps. Therefore I cannot connect to gmail service with "php_imap" and read emails. Is there any way I can solve this? Or another solution I can use?

My current link code is:

$imap = imap_open("{imap.gmail.com:993/imap/ssl}INBOX", $_POST['username'], $_POST['password']);
ADyson
  • 57,178
  • 14
  • 51
  • 63
Arif Akyol
  • 21
  • 2
  • 1
    You could use the GMail HTTP API, for example. Or use proper Gmail authentication in your front-end. Or use App Password, as mentioned by google: https://support.google.com/accounts/answer/6010255?hl=en#zippy=%2Cupdate-your-app-or-operating-system%2Cuse-an-app-password – ADyson Jun 07 '22 at 14:35

1 Answers1

2

In your account settings - security, after enabling two-step verification, set an application-specific password, which you can use to replace the original login password

QingSi
  • 21
  • 2
  • App Password unfortunately less secure apps don't work. – Arif Akyol Jun 09 '22 at 14:31
  • @ArifAkyol App Password does work, if you set it up correctly. Unfortunately you've given no details so we don't know what you may have done (or not done) or what specific error you're getting now. Update your question if you have more details. – ADyson Jun 14 '22 at 18:37