Webklex / laravel-imap

Laravel IMAP is an easy way to integrate both the native php-imap module and an extended custom imap protocol into your Laravel app.
https://www.php-imap.com
MIT License
641 stars 182 forks source link

I get an error when I try to connect to Gmail #470

Closed hackimov closed 1 year ago

hackimov commented 1 year ago

got an extra server challenge: {base64}

got failure response: NO [AUTHENTICATIONFAILED] Invalid credentials (Failure)

My config:

        'gmail' => [ // account identifier
            'host' => 'imap.gmail.com',
            'port' => 993,
            'encryption' => 'ssl',
            'validate_cert' => false,
            'username' => env('IMAP_GMAIL_USERNAME', 'root@example.com'),
            'password' => env('IMAP_GMAIL_PASSWORD', ''),
            'authentication' => env('IMAP_GMAIL_AUTHENTICATION', 'oauth'),
        ],

imap settings in gmail enabled image

Login and password are exactly correct, specially checked by going through the website by pressing CTRL + C CTRL + V

Cleared config and app cache image The data in the connection is correct.

I noticed this when looking for a bug. https://myaccount.google.com/lesssecureapps

Google has made it impossible to enable insecure apps. Marked as deprecated.

Maybe there are solutions? Thank you.

Webklex commented 1 year ago

Hi @hackimov , In order to use oAuth you'll need to provide an access token instead of the password.

Best regards,

hackimov commented 1 year ago

@Webklex Thank you, I stopped using Google.