Transactional emailUpdated · 7 min read

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.

MT
Mailbase Team
gmail smtp
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).

SettingStandard Gmail / WorkspaceNotes
SMTP Hostsmtp.gmail.comUse 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
UsernameYour full @gmail.com or Workspace emailCannot spoof arbitrary From: domains without alias setup
Password16-character Google App PasswordRegular 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 TypeRolling 24-hour LimitWhat happens when you cross it
Free @gmail.com account500 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 RelayUp 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:

Questions

About this page.

What is the Gmail SMTP server address and port?
The host is smtp.gmail.com. Use port 465 with implicit TLS (secure: true in Nodemailer) or port 587 with STARTTLS, authenticating with your full email address and a 16-character Google App Password.
Why does Nodemailer fail with 535 5.7.8 Username and Password not accepted on Gmail?
Google blocks regular account passwords over SMTP. Enable 2-Step Verification on the Google account, create an App Password under Security settings, and use that 16-character code in Nodemailer instead of your normal password.
How many emails can I send per day with Gmail SMTP?
Free @gmail.com accounts are capped at 500 messages per rolling 24 hours (and external SMTP bursts can trip limits sooner). Paid Google Workspace accounts allow up to 2,000 messages per day per user.
Should I use Nodemailer or fetch() with an email API in Node.js?
Use an HTTP email API with fetch() for any production SaaS backend: it works over port 443 on every serverless host, takes one round trip instead of 6–8, supports Idempotency-Key retries, and gives you signed bounce webhooks. Keep Nodemailer only if you must target a third-party SMTP server.