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):
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):
Port 993, encryption SSL/TLS (required)
Incoming mail (POP):
Port 995, encryption SSL/TLS (required)
POP must be turned on in Gmail settings first
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.
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.
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.
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.
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.
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
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
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
Delivers only to Gmail and Google Workspace users
The device IP must be allowlisted and included in your SPF record
Related mailX tools
Finish the setup and make sure your emails get delivered.
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.
Gmail and SMTP guides
Go further with Google's mail servers.
Google SMTP Relay Setup
When to use smtp-relay.gmail.com instead of smtp.gmail.com, and how to set it up.
IMAP vs POP3 Explained
Which protocol to choose to read your mail in another client, and why IMAP usually wins.
How to Fix SMTP Errors
What the most common SMTP error codes mean and how to solve them.
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.