SMTP Error: Could not authenticate using SMTP Gmail

I have configured the php config exactly as required.

I have defined the email account to WHERE the email should be sent (proton mail).

I have defined the gmail account which is being used to send the email.

in the ‘CONTACTFORM_SMTP_USERNAME’ field, I entered the gmail address being used to send the email.

in the ‘CONTACTFORM_SMTP_PASSWORD’ field, I entered my gmail account password.

I logged into ‘’ and added the ‘SITE_KEY’ and the ‘SECRET_KEY’.

My account already has 2 factor authentication.

What else do I need to do in order to make it work?

(other information and details relevant to your question)

Then you have to enable use of weak pwds somewhere in
I am not very sure about it…


You need to generate an app-specific password and use that as SMTP password instead of your Gmail account password, else it won’t work.


Ahh Yes,

Forgot that.

I don’t know, what makes you think you need to do anything else?

Is it not working? And if so, what do you see?

I’ve since create a brand new gmail account, specifically for handling mail.
I set the security requirement lower and it seems to work and it now forwards mail to my personal proton mail account.
The lower security settings may of helped, but I’m not sure

Which Lower Security Settings do you mean? The “Allow Less Secure Apps”? That’s one way to get SMTP access, the other is to enable 2FA and use an App Specific Password. As far as I know, you don’t need to do the Less Secure Apps stuff if you use 2FA.