Skip to content
iBlockSpam
Setup guides

What are the Gmail SMTP server settings, and how do app passwords work?

By iBlockSpam Team How we check our guides Updated 9 min read 8 sources
Short answer

Use smtp.gmail.com with port 465 (SSL) or 587 (TLS/STARTTLS), authentication on, your full Gmail or Workspace address as the username, and an app password, not your normal password. App passwords need 2-Step Verification and are created at myaccount.google.com/apppasswords. Google prefers Sign in with Google (OAuth) and, for Workspace devices, the SMTP relay.

Gmail's SMTP server lets a mail app, website, script or device send mail through a Gmail or Google Workspace account. The settings haven't changed in years, but how you sign in has: Google turned off plain username-and-password access for third-party apps in 2025, so most "it suddenly stopped working" problems are really authentication problems. This guide gives the exact settings, how app passwords work, when to use something else, and what each Gmail error means, as Google documents them at the time of writing (November 2026).

What are the Gmail SMTP settings?

The Gmail SMTP server is smtp.gmail.com, on port 465 with SSL or port 587 with TLS (STARTTLS), with authentication required. These values come from Google's POP setup page and its Workspace page on sending from a printer, scanner or app:

Setting Value
Outgoing (SMTP) server smtp.gmail.com
Port and encryption 465 with SSL (implicit TLS), or 587 with TLS/STARTTLS
Authentication Required
Username Your full address, such as name@gmail.com or name@yourcompany.com
Password An app password if 2-Step Verification is on (or OAuth, "Sign in with Google", if the app supports it)
Incoming (POP), if needed pop.gmail.com, port 995, SSL

Port 465 and port 587 are equally secure when the app is set up correctly. The difference is when encryption starts: on 465 the connection is encrypted from the first byte, and on 587 the app upgrades a plain connection with STARTTLS. RFC 8314 prefers implicit TLS (465) for new setups. Match the encryption type to the port: "SSL" with 465 and "TLS" or "STARTTLS" with 587. A mismatch usually makes the connection fail or time out. Our guide to SMTP ports 25, 587 and 465 explains the ports in more depth. For a WordPress site, see WordPress SMTP email setup with SPF and DKIM.

Google's Workspace page also lists port 25, but many internet providers and cloud hosts block outbound port 25, so use 465 or 587.

Example configuration

A typical website or app SMTP form, filled in for a Workspace mailbox (example values):

SMTP host:      smtp.gmail.com
Port:           587
Encryption:     TLS (STARTTLS)
Authentication: On
Username:       website@example.com
Password:       abcd efgh ijkl mnop   (app password, example only)
From address:   website@example.com

What is a Gmail app password?

An app password is a passcode Google generates so an app that can't do modern sign-in can still use your account. Google defines it as "a 16-digit passcode that gives a less secure app or device permission to access your Google Account" (Google Account Help).

Key facts from Google:

  • It needs 2-Step Verification. "App passwords can only be used with accounts that have 2-Step Verification turned on."
  • It bypasses 2-Step Verification. Google's Workspace admin page says plainly: "App passwords bypass 2SV" (Google). Anyone holding it can send as you without a second factor.
  • It's revoked when you change your password. Every app using one needs a new app password afterwards.
  • Google discourages it. App passwords "aren't recommended and are unnecessary in most cases." If the app offers Sign in with Google, use that.

How do you create a Gmail app password?

Create a Gmail app password on your Google Account's App passwords page, after turning on 2-Step Verification. Step by step:

  1. Turn on 2-Step Verification for the account if it isn't already on.
  2. Go to myaccount.google.com/apppasswords and sign in.
  3. Give the app password a name you'll recognize later, such as "Office scanner" or "Website contact form".
  4. Copy the passcode Google shows and paste it into the app's password field.
  5. Send a test message, then check it arrived with authentication passing (the Deliverability Test shows SPF, DKIM and DMARC results).

If the option isn't there, Google lists three reasons: the account has 2-Step Verification "set up only for security keys", you're "logged into a work, school, or another organization account", or the account has "Advanced Protection". In Google Workspace, Google says "enforcing security keys disables app passwords" (Google).

Create one app password per app or device, so you can revoke one without breaking the rest. When you retire a device or suspect a leak, revoke its app password on the same page.

Why did Gmail SMTP stop working with my normal password?

Gmail SMTP stopped working with a normal password because Google ended "less secure app" sign-in for third-party apps in 2025. Google's transition page lists March 14, 2025 as the date access to less secure apps "will be turned off for all Google Accounts", when CalDAV, CardDAV, IMAP, SMTP and POP "will no longer work with legacy passwords (basic authentication)." Its printer and scanner page gives a different date: "Starting May 1, 2025, Google Workspace accounts no longer support less secure apps", meaning apps or devices that sign in with a username and password. Google points to its Workspace Updates blog for exact dates; either way, both dates have passed.

Your options now:

Option How it signs in Best for
Sign in with Google (OAuth 2.0) A browser sign-in grants the app a token; no password stored in the app Mail clients (Outlook, Apple Mail, Thunderbird) and apps that support it
Google Workspace SMTP relay (smtp-relay.gmail.com) The device's IP address or SMTP AUTH, set up by an admin Workspace printers, scanners, servers and apps
App password on smtp.gmail.com The 16-digit app password Personal Gmail, or an app that supports nothing else
Restricted Gmail SMTP server (aspmx.l.google.com, port 25) None; Google says it "doesn't require authentication" Old Workspace devices that can't use SSL, sending only to Gmail and Workspace users

For Workspace devices, Google recommends the relay; our Google Workspace SMTP relay guide covers setup. For a scanner that can't do OAuth, the relay with IP authentication avoids storing any user's credentials on the device. Google warns that "Older scanners or printers might not support OAuth" and that such devices might not support sending email at all.

What are the Gmail SMTP sending limits?

Gmail SMTP sending limits depend on the account. Google's Workspace page says that for the Gmail SMTP server "the sending limit is 2,000 messages per day." For personal Gmail, Google's sending limits page says you'll see "You have reached a limit for sending mail" after more than 500 recipients in a single email or more than 500 emails in a day, and that you should be able to send again "within 1 to 24 hours."

Account Daily limit through smtp.gmail.com
Personal Gmail More than 500 emails a day, or 500 recipients in one email, triggers the limit
Google Workspace 2,000 messages per day
Workspace SMTP relay (different service) 10,000 messages per user per day (see our relay guide)

These limits make Gmail SMTP a poor fit for newsletters or bulk notifications. Bulk mail to Gmail users also has to meet Gmail, Yahoo and Microsoft bulk sender requirements. For limits across both major platforms, see email sending limits in Microsoft 365 and Google Workspace.

What do Gmail SMTP errors mean?

Most Gmail SMTP errors are sign-in or encryption problems, and Google lists each one on its Gmail SMTP errors and codes page:

Error Meaning Fix
535 5.7.80 Username and Password not accepted Wrong username, wrong password, or a normal password where an app password or OAuth is needed Use the full address and an app password, or switch to Sign in with Google
534 5.7.90 Application-specific password required 2-Step Verification is on and the app sent the account password Create an app password
534 5.7.14 Please log in through your web browser and then try again Google wants a browser sign-in before allowing the app Sign in to Gmail in a browser from the same network, then retry; consider OAuth
530 5.7.0 Authentication required The app tried to send without signing in Turn on SMTP authentication
530 5.7.0 Must issue a STARTTLS command first Port 587 used without TLS Set encryption to TLS/STARTTLS, or use 465 with SSL
504 5.7.40 XOAUTH is no longer supported The app uses an obsolete OAuth method Update the app to OAuth 2.0

Paste the full error into the SMTP Error Code Lookup for more detail; the 535 5.7.8 and 530 5.7.0 pages cover the general versions of the first and fourth codes.

Is it safe to use an app password?

An app password is acceptably safe for one trusted device or app, but it's a long-lived secret that skips 2-Step Verification, so treat it like a key. If someone steals it from a website config file, a backup or a scanner's web panel, they can send mail as you, which is exactly what attackers want from a compromised account.

Reduce the risk:

  1. Use a dedicated mailbox for the app, such as scanner@ or website@, not a person's mailbox.
  2. One app password per app, named clearly, so you can revoke one without breaking others.
  3. Prefer OAuth or the relay where you can. Admins should plan for app passwords to stop working if they enforce security keys for 2-Step Verification.
  4. Review and revoke regularly. Workspace admins can revoke a user's app passwords on the user's Security page in Directory > Users, and should during compromised account recovery.
  5. Keep SPF, DKIM and DMARC right. Mail sent through smtp.gmail.com leaves from Google's servers; check that your domain's SPF includes Google with the SPF Checker and see SPF for Google Workspace.

Next steps

  1. Check whether your app or device supports Sign in with Google; if it does, remove the app password.
  2. For Workspace printers and servers, move to the SMTP relay with IP authentication.
  3. List every app password in use, revoke any nobody can explain, and record the rest.
  4. Protect the inbound side too. iBlockSpam filters spam, phishing and malware at the MX before it reaches Gmail; see how it works with Google Workspace.

Browse our other setup guides.

Frequently asked questions

What is the Gmail SMTP server address?

The Gmail SMTP server is smtp.gmail.com. Use port 465 with SSL or port 587 with TLS (STARTTLS), turn on SMTP authentication, and sign in with your full email address. Google Workspace organizations also have smtp-relay.gmail.com, an admin-configured relay for devices and apps, which is a different service with different limits.

Why does Gmail say Application-specific password required?

Google returns 534 5.7.90 Application-specific password required when an app signs in with your normal password on an account that has 2-Step Verification turned on. Create an app password at myaccount.google.com/apppasswords and use it instead, or, better, switch the app to Sign in with Google if it supports it.

Why can't I find the app passwords option in my Google Account?

Google lists three reasons: 2-Step Verification is set up only for security keys, the account is a work, school or other organization account, or the account is enrolled in Advanced Protection. App passwords also need 2-Step Verification to be on. In Google Workspace, enforcing security keys as the only 2SV method disables app passwords.

Do Gmail app passwords stop working when I change my password?

Yes. Google says app passwords are revoked when you change your Google Account password, to help protect your account. Every app or device that used one will fail to sign in until you create a new app password for it. Revoke app passwords individually on the same page when you retire a device.

How many emails can I send through smtp.gmail.com per day?

For Google Workspace accounts, Google's printer, scanner and app page says the Gmail SMTP server's sending limit is 2,000 messages per day. Personal Gmail accounts hit a limit at more than 500 emails in a day or 500 recipients in one email, and Google says sending resumes within 1 to 24 hours.

Sources

  1. Google Account Help: Sign in with app passwords
  2. Google Workspace Admin Help: Send email from a printer, scanner, or app
  3. Gmail Help: Read Gmail messages on other email clients using POP
  4. Google Workspace Admin Help: Transition from less secure apps to OAuth
  5. Google Workspace Admin Help: How 2-Step Verification works with legacy apps
  6. Google Workspace Admin Help: Gmail SMTP errors and codes
  7. Gmail Help: Limits for sending and getting mail
  8. RFC 8314: Cleartext Considered Obsolete (TLS for email submission)

See how your domain measures up

Run a free Email Health Check: MX, SPF, DKIM, DMARC and transport security in one scan, with the raw records shown. No sign-up.

Keep reading