Gmail SMTP Settings, Limits & When to Switch to an Email API
Exact Gmail SMTP server settings and Nodemailer config — plus the daily limits and serverless failure modes that force apps onto an HTTP email API.
On this page · 10 sections
Overview
Every side project starts the same way: you wire up nodemailer with smtp.gmail.com, send yourself a test password reset, watch it land in Primary, and ship. For an internal cron alert or a weekend prototype, Gmail SMTP works fine.
The problems start the week real users sign up. Suddenly an App Password expires, a Vercel or Render worker times out on port 587, or Google temporarily locks the whole mailbox after a spike of verification emails. Below are the exact Gmail SMTP settings and daily limits you need right now, followed by the four concrete signs it is time to replace Nodemailer + Gmail with a ten-line HTTP fetch() call.
Exact Gmail SMTP server settings (and the App Password trap)
Google retired plain username/password SMTP logins (« Less secure apps ») years ago. To authenticate against smtp.gmail.com from code today, you must enable **2-Step Verification** on the Google account and generate a 16-character **App Password** (or use OAuth2 / Google Workspace SMTP relay with IP allowlisting).
| Setting | Standard Gmail / Workspace | Notes |
|---|---|---|
| SMTP Host | smtp.gmail.com | Use smtp-relay.gmail.com only if Workspace SMTP Relay is enabled in Admin |
| Port (SSL / implicit TLS) | 465 (secure: true) | Preferred — avoids the extra STARTTLS upgrade round trip |
| Port (STARTTLS) | 587 (secure: false) | Frequently blocked or throttled on serverless / PaaS containers |
| Username | Your full @gmail.com or Workspace email | Cannot spoof arbitrary From: domains without alias setup |
| Password | 16-character Google App Password | Regular Google account password will fail with 535 5.7.8 |
Real Gmail & Google Workspace sending limits
Google publishes hard rolling 24-hour ceilings, and hitting them does not just pause your app — it blocks the human owner of that mailbox from sending normal email for up to 24 hours.
| Account Type | Rolling 24-hour Limit | What happens when you cross it |
|---|---|---|
Free @gmail.com account | 500 emails / day (100 via external SMTP clients in bursts) | 550 5.4.5 Daily user sending limit exceeded + temporary lockout |
| Google Workspace (paid) | 2,000 emails / day (1,500 via mail merge) | Hard deferral/lockout for up to 24h on that user seat |
| Workspace SMTP Relay | Up to 10,000/day per user (domain-wide cap applies) | Still lacks bounce webhooks, suppression lists, and per-message logs |
Nodemailer + Gmail SMTP vs a 10-line HTTP Email API
With Nodemailer, every cold serverless invocation opens a TCP socket to smtp.gmail.com, runs 6 to 8 sequential SMTP handshakes (220 → EHLO → AUTH → MAIL FROM → RCPT TO → DATA → QUIT), and returns no structured delivery webhook if the recipient's inbox bounces five minutes later. Worse, Gmail rewrites your From: header to your mailbox address unless you manually register aliases, and you have no Idempotency-Key if a webhook retry triggers the same receipt twice.
Switching from Nodemailer to an HTTP email API removes the SMTP library altogether. With Mailbase's transactional email API (backed by Amazon SES in eu-west-1 Ireland), one standard fetch() call over port 443 replaces the entire SMTP pool: POST https://mailbase.studio/api/v1/send with Authorization: Bearer mb_..., Idempotency-Key, and JSON { to, subject, html, text, transactional: true }. You get an immediate message ID, automatic hard-bounce suppression, and signed delivery/bounce webhooks — with zero SMTP ports to unblock. Read the full protocol comparison in Email API vs SMTP or copy the payload from the API quickstart.
Four signals you have outgrown Gmail SMTP
Keep Gmail SMTP for personal scripts, home-lab alerts, or staging apps that send five messages a day to yourself. Move to a dedicated transactional email API the moment any one of these four happens:
- **You send customer-facing auth mail** (password resets, magic links, 2FA codes) where a 24-hour Gmail lockout breaks login for every user.
- **You deploy on serverless or edge runtimes** (Vercel, Cloudflare, AWS Lambda, Fly) where outbound port 587 is slow, blocked, or cannot hold warm TCP pools.
- **You need bounce visibility and logs** — knowing whether a customer's invoice bounced (
550 User unknown) instead of silently vanishing in a Sent folder. - **You send more than ~50–100 product emails/day** and want your own authenticated domain (
SPF,DKIM,DMARC) isolated from your personal inbox reputation.
Common mistakes
- Sending product-critical mail and marketing from the same domain/reputation.
- Skipping idempotency, so retries create duplicate sends.
- Ignoring bounce and complaint webhooks until suppression breaks.
- Treating an email API as “fire and forget” with no event logging.
Sources and further reading
Official docs for current setup details, pricing, and API behavior — verify specifics there, since they change.
Related guides
More on gmail smtp and the surrounding transactional email workflow: