Mailbox · SMTP settings
Gmail SMTP settings
The Gmail SMTP server is smtp.gmail.com on port 587 (STARTTLS) or 465 (SSL). Sign in with your full Gmail address and an app password, because Google no longer accepts your regular password from mail apps and scripts.
Last reviewed November 2026
| SMTP server | smtp.gmail.com |
|---|---|
| Port (recommended) | 587 (STARTTLS) |
| Port | 465 (SSL/TLS) |
| Username | Your full Gmail address (name@gmail.com) |
| Password | A 16-character app password |
| Authentication | Required |
| IMAP server | imap.gmail.com |
|---|---|
| IMAP port | 993 (SSL/TLS) |
| POP3 server | pop.gmail.com |
| POP3 port | 995 (SSL/TLS) |
Sending limits
Personal Gmail accounts can send to about 500 recipients a day. Google may temporarily block sending if you exceed it.
How to create a Gmail app password
Most mail apps and code libraries need an app password rather than your normal password. Google only shows the option once 2-Step Verification is on.
- Turn on 2-Step Verification at myaccount.google.com/security.
- Open App passwords (search for it in your Google Account settings).
- Enter a name such as "Website SMTP" and click Create.
- Copy the 16-character password and use it as the SMTP password. Google shows it only once.
If your organisation uses Google Workspace, an admin may have disabled app passwords. See Google Workspace SMTP settings for the relay alternative.
Gmail SMTP settings in code
import nodemailer from "nodemailer";
const transport = nodemailer.createTransport({
host: "smtp.gmail.com",
port: 587,
secure: false, // STARTTLS upgrades the connection
auth: { user: "you@gmail.com", pass: process.env.GMAIL_APP_PASSWORD },
});
When Gmail SMTP stops being enough
Gmail SMTP is fine for a contact form or a personal script. It is a poor fit for an application: the daily cap is low, mail is sent as your personal address, there are no delivery webhooks, and Google can lock the account if a script misbehaves. For product email (password resets, receipts, notifications), use a transactional email service with your own domain, such as the Stack Emails SMTP relay or REST API.
Check your domain's email records
If you send from your own domain, receiving servers check SPF, DKIM and DMARC. Use our free SPF checker, DKIM checker and DMARC checker to confirm they pass.
Settings checked against Gmail's public help pages. Providers change authentication rules from time to time, so confirm in their documentation if something doesn't work.