Gmail SMTP Server IP Address: What to Use
In this article
There is no single Gmail SMTP server IP address you should configure. Gmail's SMTP service is reached through the hostname smtp.gmail.com, and Google rotates the underlying IP addresses behind that name. If you hard-code an IP address, your mail will eventually fail when Google changes it. The correct approach is to use the hostname, port 587 with STARTTLS (or port 465 with SSL/TLS), and your Google account credentials or an App Password. This article explains why the IP address is not the right thing to look for, how the service actually works, and what to do instead.
Why There Is No Fixed Gmail SMTP IP Address
Google operates smtp.gmail.com as a load-balanced service. A DNS lookup returns one or more IP addresses from a pool, and those addresses can change over time as Google adds capacity, retires hardware, or shifts traffic between data centers. The IP range belongs to Google, but the specific address you see today may not be the one your mail client uses tomorrow, and different networks may resolve the same hostname to different addresses.
This is normal for large email providers. Microsoft, Yahoo, and most transactional email services do the same thing. The hostname is the stable identifier; the IP address is an implementation detail that changes. For this reason, Google's own documentation tells users to configure smtp.gmail.com, not an IP address. If you are building a firewall rule or an allowlist, you would need to allow Google's published IP ranges, which are documented for Google Workspace but are not a single SMTP address.
If you are troubleshooting a connection problem, you can look up the current IP with a DNS query (for example, nslookup smtp.gmail.com on Windows or dig smtp.gmail.com on macOS and Linux), but treat the result as temporary. Do not paste that IP into your mail client's server field.
What to Use Instead: Hostname, Ports, and Encryption
The settings that actually work are the hostname and the port. Gmail supports two common configurations for sending mail through its SMTP server:
- Port 587 with STARTTLS — the standard submission port. The connection starts unencrypted and is upgraded to TLS. This is the recommended choice for most mail clients.
- Port 465 with SSL/TLS — an implicit TLS port. Some older clients and devices only offer this option.
Port 25 is generally not usable for Gmail SMTP submission, and many networks block it. Port 587 is the safest default. The server hostname is smtp.gmail.com for both. Your username is your full Gmail address, and your password is either your Google account password (only if your account still allows it) or, more commonly now, a Google App Password.
Labels in mail client settings can differ slightly by app and version. Look for fields named "SMTP server," "Outgoing mail server," "Server hostname," or similar. The values you enter are the same regardless of the label.
Authentication: App Passwords and 2-Step Verification
Google has tightened sign-in requirements over time. If your Google account has 2-Step Verification enabled — and most accounts should — your regular password will not work for SMTP. You need an App Password, which is a 16-character code generated in your Google Account security settings. App Passwords are available only when 2-Step Verification is on. If you do not see the App Passwords option, check that 2-Step Verification is enabled first.
Some Google Workspace accounts have App Passwords disabled by an administrator. In that case, SMTP authentication with a simple username and password may not be available, and you would need to use OAuth 2.0, which many modern mail clients support. If you are setting up a device that only accepts a username and password, check with your Workspace administrator before assuming it will work.
Never share an App Password or paste it into a public forum. Treat it like a password. If you suspect it has been exposed, revoke it in your Google Account settings and generate a new one.
Common Problems and How to Fix Them
Most Gmail SMTP failures fall into a few categories. Work through these checks in order:
- Authentication failed. Confirm you are using an App Password, not your normal password, and that 2-Step Verification is on. Re-enter the password carefully; App Passwords are often copied with stray spaces.
- Connection timed out. Try port 587 with STARTTLS first, then port 465 with SSL/TLS. Check whether your network or internet provider blocks outgoing SMTP ports.
- Certificate or TLS error. Make sure the encryption setting matches the port: STARTTLS for 587, SSL/TLS for 465. An mismatched setting will often produce a handshake failure.
- "Less secure app" message. Google removed the less secure apps option for most accounts. If you see advice to enable it, that advice is outdated; use an App Password instead.
- Daily sending limits. Gmail accounts have sending limits, and exceeding them can cause temporary blocks. If you are sending bulk mail, Gmail SMTP is not the right tool; use a transactional email service.
If none of these resolve the issue, check Google's Workspace status page for service problems, then try a different mail client to isolate whether the problem is the client or the account. Signing out and back in, or restarting the device, is also worth trying before more involved changes.
Gmail SMTP vs. Other Sending Options
Gmail SMTP is convenient for personal use and small-scale sending from a mail client or a device that needs to send notifications. It is not designed for marketing email or high-volume transactional mail. For those use cases, dedicated services provide better deliverability, analytics, and higher limits. Gmail SMTP also sends from your Gmail address; if you need to send from a custom domain, Google Workspace supports that, but a personal Gmail account does not.
Another common comparison is between Gmail SMTP and Gmail's IMAP or POP settings. SMTP is for outgoing mail; IMAP and POP are for incoming mail. A mail client typically needs both: an incoming server to receive and an outgoing server to send. Mixing these up is a frequent source of confusion when setting up a new device.
Safety and Account Security
Using Gmail SMTP means storing credentials in a mail client or device. Keep these points in mind:
- Use an App Password rather than your main account password, and revoke it if the device is lost or replaced.
- Keep 2-Step Verification enabled on your Google account.
- Do not configure SMTP on shared or public devices unless you can remove the credentials afterward.
- Be wary of any tutorial that tells you to disable security features or use an unofficial relay. Those approaches can expose your account.
If you are an administrator, consider restricting App Password use and monitoring for unusual sending activity. Google's account security settings include tools for reviewing connected devices and recent security events.
Frequently Asked Questions
Can I just use the IP address of smtp.gmail.com in my mail client?
You can enter an IP address in some clients, but it is not recommended. Google rotates the addresses behind the hostname, so a hard-coded IP will eventually stop working. Use the hostname smtp.gmail.com instead.
What port should I use for Gmail SMTP?
Use port 587 with STARTTLS as the default. If your client does not support STARTTLS, use port 465 with SSL/TLS. Port 25 is usually blocked and not recommended.
Why does my password not work for Gmail SMTP?
If 2-Step Verification is enabled, you need an App Password rather than your normal Google password. Generate one in your Google Account security settings. If the App Passwords option is missing, confirm that 2-Step Verification is turned on.
Is Gmail SMTP free?
Gmail SMTP is available with a personal Gmail account at no cost, subject to Google's sending limits and terms. Google Workspace accounts have their own limits and administrator controls.
Does Gmail SMTP work for sending bulk email?
No. Gmail SMTP is intended for normal personal or small-scale sending. For bulk or marketing email, use a dedicated email service that is designed for that purpose.