Make PHPmailer a “more secure application” for Gmail

What security can we implement in PHPmailer to make it more secure for Gmail? https://support.google.com/accounts/answer/6010255 I use PHPmailer to send letters through Gmail. PS: I do not want to include "access for less secure applications" here: https://www.google.com/settings/security/lesssecureapps , I want to make the application more secure.

+4
source share
1 answer

Gmail has begun introducing a new authentication mechanism that replaces SMTP authentication for OAuth2-based authorization. Documents about their changes can be found here .

This really does not improve security, because ultimately you still need to send your username and password over SSL at some point (the mechanism itself, which Google considers unsure) for authentication, in order to get an OAuth token that is just as secure as well as existing SMTP authorization systems.

While PHPMailer does not support this new mechanism - welcome PR! You will need an OAuth2 class, like this one , and maybe use this sample code .

" ", SMTPSecure = 'tls' Port = 587 auth PHPMailer.

Update

PHPMailer Gmail XOAUTH2 5.2.11. . . 6.0 .

+10

All Articles