Posted by : Safras Ahamed Saturday, July 2, 2016

I am using php to connect and download mail from and also to send email using this was working without any problem, sudenly this stop working and started to give error messages as bellow.

Fatal error: Uncaught exception 'ImapMailboxException' with message 'Connection error: Can not authenticate to IMAP server: [ALERT] Please log in via your web browser:' in /xxxxxx/classes/ImapMailbox.php:51 Stack trace: #0 /home/xxxx/public_html/_backoffice/mailpilot/classes/ImapMailbox.php(42): ImapMailbox->initImapStream() #1 /xxxxxx/classes/ImapMailbox.php(114): ImapMailbox->getImapStream() #2 /xxxxxx/mail.v3.php(28): ImapMailbox->searchMailbox('ALL') #3 {main} thrown in/xxxxx/classes/ImapMailbox.php on line 51

Was looking for a solution two weeks and finally google contacted me with an answer, here is what you have to do.

It seems this error is related to the access to "Less secure apps" disabled for the user you're trying to connect via IMAP. Please follow these steps to solve this issue:

 1. In your Admin Console, follow the steps available at this support article under the section "Enabling less secure apps to access accounts".

2. Log in as the affected user and follow the steps to "Allow less secure apps to access your account" as described at this support article

 Thanks Saf

Leave a Reply

Subscribe to Posts | Subscribe to Comments

Popular Post

Blogger templates


- Copyright © My Code Genius by 2 Geniuses -Metrominimalist- Powered by Blogger - Designed by Johanes Djogan -