Gmail SMTP settings: smtp.gmail.com, port 587/465, app password

Exact Gmail SMTP server settings: smtp.gmail.com, port 587 (STARTTLS) or 465 (SSL), your full Gmail address and a 16-character app password. Sending limits, common 535/534 errors and fixes.

Gmail outgoing mail server: smtp.gmail.com, port <code>587</code> (STARTTLS) or <code>465</code> (SSL/TLS) or <code>25</code> (STARTTLS), username = your full address, password = a 16-character App Password.

Gmail SMTP settings at a glance

Outgoing (SMTP) hostsmtp.gmail.com
Ports & encryption
587 — STARTTLS <em>(recommended)</em>
465 — SSL/TLS
25 — STARTTLS <em>(works but is blocked by most ISPs and clouds)</em>
Usernameyour full address, e.g. you@gmail.com
Passworda 16-character App Password (not your normal password)
AuthenticationGoogle removed "less secure app access" in 2022. Any app that signs in with a plain password must use an App Password, which requires 2-Step Verification on the account. OAuth 2.0 (XOAUTH2) is the alternative for apps that support it.

How to set up Gmail SMTP

  1. Turn on 2-Step Verification: Google Account → Security → 2-Step Verification.
  2. Create an App Password: Google Account → Security → 2-Step Verification → App passwords (or search "App passwords"). Name it after the app, copy the 16 characters (spaces are ignored).
  3. In your app: host smtp.gmail.com, port 587, encryption STARTTLS (or 465 with SSL/TLS), username = your Gmail address, password = the App Password.
  4. Set the From address to the same Gmail address (or a verified "Send mail as" alias) and send a test.

Sending limits

  • 500 messages per day for a free @gmail.com account, counted by recipient; 2,000 per day on Google Workspace.
  • Up to 500 recipients per message from a mail client; fewer via SMTP from an app.
  • The From address must be the account itself or an address added under "Send mail as" — Gmail rewrites anything else.
  • Hitting the cap returns "550 5.4.5 Daily user sending limit exceeded" and blocks sending for up to 24 hours.

Things that catch people out

  • Google Workspace admins can disable App Passwords; if the option is missing, ask the admin or use OAuth.
  • A new App Password is needed for each device/app; changing the Google password revokes them all.
  • Gmail adds its own Message-ID and may put your own address in Reply-To if the From is rewritten.

Common Gmail SMTP errors

Server replyMeaningFix
535-5.7.8 Username and Password not acceptedWrong credentials or a normal password where an App Password is required.Create an App Password and use the full email address as username.
534-5.7.9 Application-specific password required2-Step Verification is on and the app used the account password.Use an App Password.
550-5.4.5 Daily user sending limit exceededYou passed 500/day (free) or 2,000/day (Workspace).Wait 24 h, or move application mail to a relay that is not capped per mailbox.
421-4.7.0 Try again later, closing connectionRate limiting or a suspicious connection pattern.Back off, send fewer connections in parallel, keep one connection per batch.

More codes: 535 authentication failed, 550 relay denied, 554 rejected as spam, connection timed out — or all SMTP error codes.

When Gmail is not enough for your app

When a provider caps you or blocks a port, point the same app at QueenSMTP instead: host smtp.queensmtp.com, port 587 (STARTTLS) or 465 (SSL), your SMTP username and password from the dashboard. $5/year plus $0.10 per 1,000 emails, 100 free a day to test.

Get SMTP credentials — free to test Test Gmail now

Verified 2026-08-30 against Gmail's documentation and live DNS. Found a change? Tell us.

Gmail SMTP — questions

smtp.gmail.com. Use port 587 with STARTTLS or port 465 with SSL/TLS, your full Gmail address as the username and an App Password as the password.

Yes, for low volume (a contact form, a few hundred notifications a day). Above 500 recipients per day (2,000 on Workspace) Gmail blocks you for 24 hours, and the From address must be your Gmail address, so most sites move to an SMTP relay once they grow.

Because the app sent your normal password. Since 2022 Gmail only accepts App Passwords (with 2-Step Verification enabled) or OAuth 2.0 from third-party apps.

Yes for a personal account, within the 500-messages-per-day limit. Google Workspace raises it to 2,000 per day and adds the smtp-relay.gmail.com relay for servers.