I followUsing Gmail with XOAUTH2 (PHPMailer Wiki) andHow to use PHPMailer with Gmail XOAUTH2 to send emails? (Chandan for w3jar.com; May 2019). < /p>
Today, my website was unable to send emails because the refresh token expired.
Then I read the PHPMailer Wiki again and found this:
So, I need to go to this page and click Google
.
Then select the account I will send emails to.
The new token refresh will be displayed as shown below.
After that I need to copy this refresh token and paste it into my send email function.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
|
This is what I have to do when the token expires.
Gmail doesn't have any notification about refresh token expiration.
This creates problems for people using my site. Until someone contacted me and told me about this problem.
How to automatically obtain the refresh token?
This step requires someone to click the Google
button and then click on the Gmail account to get the refresh token.
Can I use PHP? How can I automate this process?
P粉1484347422024-04-07 08:56:06
Finally, I use two-step verification. Reference: https://www.youtube.com/watch?v= mte7LroYd74&list=LL&index=1&t=2s