I have a created an account from G Suite - [email protected]. I have enabled 2-factor authentication and created app-specific password too.
Also, I read that I need to allow less secure apps but I can't as I did 2-factor auth.
Also, my domain is working on ssl certificate from LetsEncrypt.
This is my config file:
MAIL_DRIVER=smtp
MAIL_HOST=smtp-relay.gmail.com // or smtp.gmail.com
MAIL_PORT=465 // or 587
[email protected]
MAIL_PASSWORD=unkdgapoymfgcwxu << app specific password
MAIL_ENCRYPTION=ssl // or tls
[email protected]
MAIL_FROM_NAME=Support
From admin dashboard, I ticked the 'SMTP-relay' setting:
Allowed senders: Only addresses in my domains
Only accept mail from the specified IP addresses: No
Require SMTP Authentication: Yes
Require TLS encryption: No
...and I also added 'Support' as 'Send mail as' input in Gmail Settings > Accounts
I am stuck and keep getting error:
Expected response code 250 but got code "535", with message "535-5.7.8 Username and Password not accepted. Learn more at 535 5.7.8 https://support.google.com/mail/?p=BadCredentials i203sm350313wmf.0 - gsmtp
I have tried all different combinations but I couldn't move any further than this error. What am I doing wrong?
I know there are many questions related this topic but I couldn't find anything working for specifically G Suite - with custom domain
I am not sure if G Suite is any different than Gmail, but when I tried with personal gmail account it works. So, if I try for my personal gmail with this config, it works:
MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=465
[email protected]
MAIL_PASSWORD=utrpokvkvwluwujx < one time password
MAIL_ENCRYPTION=ssl
smtp.gmail.com
. This is what I have in my setup and it works. Also tryMAIL_ENCRYPTION=tls
and yourMAIL_PORT=587
– Felix Lebel