New: mailX now works inside ChatGPT. Try it →
Gmail SMTP Settings

Gmail SMTP Settings: smtp.gmail.com, Ports and Login

Gmail's outgoing server is smtp.gmail.com on port 587 with STARTTLS, or 465 with SSL. Pick Gmail in the list below to get the full settings, then test your connection before you go live.

Results

  • Settings from Google's documentation
  • Gmail and Google Workspace
  • Free, no signup

Gmail SMTP, IMAP and POP settings at a glance

The same servers work for personal Gmail accounts and Google Workspace accounts on your own domain. Your username is always your full email address. What changes from one app to another is how you log in: Sign in with Google (OAuth) when the app offers it, an app password when it does not. Using another provider? See the Outlook.com SMTP settings or the Yahoo SMTP settings, and which SMTP port to use.

Outgoing mail (SMTP):

Server: smtp.gmail.com
Port 587, encryption STARTTLS (recommended)
Port 465, encryption SSL/TLS
Authentication: required
Username: your full Gmail or Google Workspace address
Password: Sign in with Google, or an app password

Incoming mail (IMAP):

Server: imap.gmail.com
Port 993, encryption SSL/TLS (required)

Incoming mail (POP):

Server: pop.gmail.com
Port 995, encryption SSL/TLS (required)
POP must be turned on in Gmail settings first
How it works

How to set up Gmail SMTP in an app or email client

Five steps to send through Gmail from Outlook, Thunderbird, a CRM, a printer or your own code.

01

Use Sign in with Google if the app offers it

Outlook, Apple Mail, Thunderbird and most recent apps connect to Gmail with OAuth. You sign in on a Google page and never type your password into the app.

02

Otherwise, create an app password

Turn on 2-Step Verification on your Google Account, then create an app password: a 16-character code that replaces your password in that one app. Your regular Google password will be refused.

03

Enter the SMTP settings

Server smtp.gmail.com, port 587 with STARTTLS (or 465 with SSL), authentication on, and your full email address as the username.

04

Test the connection

Run the mailX SMTP test with the same host, port and login. It tells you whether the server answers, whether the encryption works and whether your credentials are accepted.

05

Sending from your own domain? Check its DNS

For Google Workspace on a custom domain, your SPF record must include _spf.google.com and Google's DKIM key must be published. Check both, plus DMARC, in one test.

Gmail sending limits

Gmail SMTP is built for people, not for mass sending. These limits apply to smtp.gmail.com.

Personal Gmail: 500 a day

Google blocks sending after more than 500 emails in a day, or a single email to more than 500 recipients. Sending comes back within 1 to 24 hours.

Google Workspace: 2,000 a day

Each paid Workspace user can send 2,000 messages a day over a rolling 24 hours. Trial accounts are limited to 500.

100 recipients per SMTP message

When you send through SMTP from an IMAP or POP client, Workspace counts at most 100 recipients per message.

Up to 24 hours blocked

Going over a limit stops sending for up to 24 hours. The account still receives mail.

SMTP relay for apps and devices

Workspace admins can route app and device mail through smtp-relay.gmail.com, with up to 10,000 recipients a day per user.

Newsletters and cold email

For campaigns or high volume, use a sending service with its own SMTP settings. Gmail limits and spam filters are not built for it.

Which Google SMTP server should you use?

Google runs three outgoing servers. Most people only need smtp.gmail.com. The other two are for Google Workspace admins who connect printers, scanners and internal apps.

smtp.gmail.com: any Gmail or Workspace account

Login with your account (OAuth or app password)
Sends to anyone, inside or outside your organization
Ports 465 (SSL) or 587 (STARTTLS)
Per-user sending limits apply

smtp-relay.gmail.com: Google Workspace only

Set up by an admin in the Google Admin console
Authenticates the device or app by its IP address
Ports 25, 465 or 587
Up to 10,000 recipients a day per user

aspmx.l.google.com: restricted server

No login and no TLS required, port 25
Delivers only to Gmail and Google Workspace users
The device IP must be allowlisted and included in your SPF record

Why Gmail SMTP refuses to connect

The usual errors when the settings look right but sending fails.

535-5.7.8 Username and Password not accepted

Your regular Google password does not work in third-party apps. Use Sign in with Google or an app password.

534-5.7.9 Application-specific password required

2-Step Verification is on and the app sent your normal password. Create an app password and use it instead.

No app password option

App passwords only exist when 2-Step Verification is on. The option can be missing on work or school accounts, with Advanced Protection, or when 2-Step Verification uses security keys only.

Wrong port and encryption pair

587 goes with STARTTLS, 465 goes with SSL/TLS. Mixing them makes the connection hang or fail with a TLS error.

Port blocked by your network or host

Many ISPs and cloud hosts block port 25, and some block 465 or 587. Test from the machine that will send.

Sending limit reached

Gmail answers with a limit error after 500 emails a day on a personal account, 2,000 on Workspace. Wait up to 24 hours or move bulk sending to a sending service.

Gmail IMAP and POP: what changed recently

IMAP is always on for personal accounts. Since January 2025, personal Gmail accounts no longer have an Enable IMAP switch: IMAP access is on by default. On Google Workspace, the admin decides whether IMAP and POP are allowed.

Username and password logins are gone on Workspace. Since 2025, Google Workspace accounts no longer accept apps that sign in with only a username and password. Use OAuth, or an app password where your admin allows it.

POP still works to read Gmail elsewhere. Turn it on in Gmail under Settings, See all settings, Forwarding and POP/IMAP. What Google is removing is the opposite direction: Check mail from other accounts, which pulled mail from another provider into Gmail with POP. It is closed to new users after the first quarter of 2026 and stops for existing users in January 2027.

Sending from your own domain through Google?

Google Workspace mail reaches the inbox when SPF, DKIM and DMARC are set up for your domain. Check all three in one free test.

Gmail SMTP Settings FAQ

Servers and ports

What is the Gmail SMTP server?
smtp.gmail.com. Use port 587 with STARTTLS or port 465 with SSL/TLS, with authentication on and your full email address as the username.
Should I use port 587 or 465 for Gmail?
Both are encrypted. Use 587 with STARTTLS by default, and 465 if your app only offers SSL/TLS from the start of the connection.
What are the Gmail IMAP settings?
imap.gmail.com, port 993, SSL/TLS. Use your full email address and Sign in with Google or an app password.
What are the Gmail POP settings?
pop.gmail.com, port 995, SSL/TLS. Turn POP on first in Gmail settings, under Forwarding and POP/IMAP.

Login

Why does Gmail reject my password in Outlook or my app?
Google no longer accepts your regular password in third-party apps. Use Sign in with Google if the app offers it, otherwise an app password created after turning on 2-Step Verification.
How do I create a Gmail app password?
Turn on 2-Step Verification in your Google Account, then open the App passwords page, name the app and copy the 16-character code into the app's password field.
Why did my app password stop working?
Google revokes your app passwords when you change your Google Account password. Create a new one and update it in the app.
Can I still turn on Less secure apps?
No. Google Workspace removed it in 2025, and personal accounts must use Sign in with Google or an app password.

Limits and deliverability

How many emails can I send per day with Gmail SMTP?
About 500 a day on a personal Gmail account and 2,000 a day per Google Workspace user (500 on a trial). Going over blocks sending for up to 24 hours.
Can I use Gmail SMTP for newsletters or cold email?
It is not built for it. The daily limits are low and bulk sending from a personal account gets filtered or suspended. Use a sending service with its own SMTP server.
Do I need SPF and DKIM to send through Gmail with my own domain?
Yes. With Google Workspace on your domain, add include:_spf.google.com to your SPF record, publish the DKIM key from the Admin console, and add a DMARC record. Gmail requires SPF or DKIM from every sender, and all three from bulk senders.