You have to check two important things when you want to send emails via Gmail smtp:
-
Your apps configuration:
- host:
smtp.gmail.com
- port:
587
or465
(587 for tls, 465 for ssl) - protocol:
tls
orssl
- user:
[email protected]
- password:
YOUR_PASSWORD
- host:
-
The given Gmail account settings:
- If you’ve turned on 2-Step Verification for your account, you might need to enter an App password.
- Without 2-Step Verification:
- Allow less secure apps access to your account.
- Visit http://www.google.com/accounts/DisplayUnlockCaptcha and sign in with your Gmail username and password.