Get mail from gmail account using php IMAP
P粉930448030
P粉930448030 2024-03-19 20:31:47
0
1
338

I used the php imap function to connect and get the email from the Gmail account and it was working fine, but now, due to their updated policy, I am getting the following error even though the login credentials are correct

PHP Warning: imap_open(): Couldn't open stream {imap.gmail.com:993/ssl/novalidate-cert}[Gmail]/All Mail in

PHP Notice: Unknown: Retrying PLAIN authentication after [AUTHENTICATIONFAILED] Invalid credentials (Failure) (errflg=1) in Unknown on line 0

I think this is because they updated their policy. Is there any way to do this?

These are the current codes connected to the account

$hostname = '{imap.gmail.com:993/ssl/novalidate-cert}[Gmail]/All Mail';
$imap = imap_open($hostname, $username, $password);
$emails = imap_search($imap, 'ALL');
if($emails) echo count($emails);

P粉930448030
P粉930448030

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!