Gmail SMTP Settings
Server smtp.gmail.com, port 587
with STARTTLS. Full configuration, authentication requirements and
fixes for the errors Gmail actually returns.
Gmail accepts SMTP submissions on smtp.gmail.com, but since Google switched off "less secure app access" you must authenticate with an App Password or OAuth 2.0. A plain account password will always return a 535 authentication error.
Gmail SMTP server settings
Outgoing mail (SMTP)
- SMTP server
- Port
- STARTTLS · Recommended SSL/TLS · Implicit TLS
- Encryption
- STARTTLS
- Authentication
- App Password (2-Step Verification must be on) or OAuth 2.0
- Username
- Your full Gmail address (e.g. [email protected])
- Password
- 16-character Google App Password — not your account password
- Sending limit
- 500 recipients/day on free Gmail; 2,000/day on Google Workspace
Incoming mail settings (IMAP & POP3)
SMTP sends mail; IMAP and POP3 retrieve it. You will usually need both sides configured for a working mail client.
| Protocol | Server | Port | Encryption |
|---|---|---|---|
| SMTP Outgoing | smtp.gmail.com |
587 | STARTTLS |
| IMAP Incoming | imap.gmail.com |
993 | SSL/TLS |
| POP3 Incoming | pop.gmail.com |
995 | SSL/TLS |
How to set up Gmail SMTP
- Open your Google Account and go to Security.
- Turn on 2-Step Verification if it is not already enabled — App Passwords are hidden until you do.
- Go to Security → App passwords, create one named "SMTP", and copy the 16-character code.
- Use
smtp.gmail.comwith port587and STARTTLS. - Enter your full Gmail address as the username and the App Password as the password.
- Run the test above — a success means Gmail accepted the credentials and relayed the message.
Verify it before you deploy. Paste these settings into the free SMTP test tool and send yourself a test message. It takes about twenty seconds and tells you whether Gmail accepted the connection, the encryption and the login — before your application depends on it.
Common Gmail SMTP errors
| Error | What to do |
|---|---|
535-5.7.8 Username and Password not accepted |
You are using the account password. Generate an App Password instead, and paste it without spaces. |
Connection timed out on port 587 |
Your ISP or host is blocking outbound SMTP. Try port 465 with SSL/TLS, or ask your host to open port 587. |
550-5.7.1 Daily sending quota exceeded |
You have hit the 500/2,000 recipient daily cap. It resets on a rolling 24-hour window. |
Seeing a reply code that isn't listed here? Every standard SMTP response is explained in our SMTP error code reference.
Gmail SMTP — frequently asked questions
The Gmail SMTP server is smtp.gmail.com. Connect on port 587 using STARTTLS encryption.
Port 587 with STARTTLS (Recommended). Port 465 with SSL/TLS (Implicit TLS).
Username: Your full Gmail address (e.g. [email protected])
Password: 16-character Google App Password — not your account password
You are using the account password. Generate an App Password instead, and paste it without spaces.
Your ISP or host is blocking outbound SMTP. Try port 465 with SSL/TLS, or ask your host to open port 587.
You have hit the 500/2,000 recipient daily cap. It resets on a rolling 24-hour window.