Gmail
Gmail API vs SMTP for Sending Email
Published 2026-09-20 · CSV Sender
Compare Gmail API OAuth sending with SMTP relay for CSV-based outreach—credentials, scopes, MIME, and why CSV Sender standardizes on messages.send.
Quick answer
Gmail API vs SMTP is a choice between Google’s HTTPS JSON messages.send endpoint and classic SMTP submission (usually port 587). CSV Sender uses the Gmail API with OAuth gmail.send because Google steers third-party apps away from password-based SMTP, and OAuth gives granular revocation without sharing mailbox passwords.
Authentication model
| Aspect | Gmail API (CSV Sender) | SMTP |
|---|---|---|
| Credentials | OAuth access + refresh tokens | Username + app password or relay key |
| Rotation | Refresh access token automatically | Manual password rotation |
| Scope | Explicit consent per scope | Full mailbox access implied |
| Revocation | Google Account app permissions | Change password |
See OAuth access vs refresh token and /security.
MIME and content
Both paths ultimately transmit RFC 5322 MIME. CSV Sender builds MIME server-side for each prepared row (gmail API send email). SMTP clients would do the same bytes over STARTTLS—extra operational burden without CSV Sender’s queue semantics (Gmail sending queue).
Deliverability and limits
Neither API nor SMTP bypasses Gmail account sending limits (Gmail sending limits for CSV). API calls also consume project quota (Gmail API rate limits).
When SMTP still appears in stacks
Legacy scripts, printers, or MTA relays sometimes require SMTP. Greenfield CSV workflows on Google Workspace should prefer API + OAuth per Google’s current guidance (frontmatter sources).
CSV Sender product boundary
The worker calls sendGmailMessage (API wrapper), not Nodemailer SMTP. That keeps one code path for retries, idempotency, and error classification (idempotent email sending).
FAQ
Can I force SMTP in CSV Sender?
No—product standardizes on Gmail API.
Is SMTP faster?
Latency differs slightly; pacing dominates CSV campaigns.
Does SMTP skip OAuth consent?
It replaces consent with long-lived passwords—worse for security.
What about Google Workspace SMTP relay?
Enterprise relay is separate—evaluate with IT; CSV Sender targets user mailbox OAuth.
Where is send documented?
Google’s sending guide linked in sources.
Related reading
TLS and transport details
SMTP submission typically uses STARTTLS on port 587 with AUTH after EHLO. Gmail API sends over HTTPS to gmail.googleapis.com—different wire protocol, similar need for correct MIME formatting.
App passwords vs OAuth
Google has reduced reliance on app passwords for consumer accounts. OAuth refresh flows scale better for multi-day CSV campaigns because password rotation does not silently break long-running queues.
Observability differences
SMTP logs in legacy systems often live on MTA machines. Gmail API errors return structured JSON suitable for classification in email send retries—CSV Sender maps them to RATE_LIMIT, AUTH, etc.
Hybrid architectures
Some enterprises SMTP-relay outbound mail while users read Gmail UI. CSV Sender is not that relay—it sends as the connected user via API, which matters for SPF/DKIM alignment appearing as the user’s mailbox.
Vendor lock-in considerations
Switching from SMTP to API affects credential storage, error handling, and quota monitoring—but CSV Sender already standardized on API to reduce password handling scope for SaaS operators.
Migration checklist from SMTP scripts
Teams replacing legacy Nodemailer cron jobs should map: SMTP credentials → OAuth connect, envelope recipients → CSV columns, batch loops → claim_due_messages pacing, error strings → structured retry classes.
Run parallel dry-run campaigns at low daily caps before decommissioning SMTP infrastructure to compare bounce handling workflows—you may need manual suppression imports where SMTP logs previously auto-fed blocks.
Production checklist (1)
Before changing live campaigns, re-verify Gmail sender CONNECTED, scan import issues, confirm suppression imports, and align dailyLimit with Gmail sending limits for CSV guidance. Prepared rows in email, subject, and body columns should pass validate CSV before emailing so queue workers spend quota on intentional mail only.
Production checklist (2)
Before changing live campaigns, re-verify Gmail sender CONNECTED, scan import issues, confirm suppression imports, and align dailyLimit with Gmail sending limits for CSV guidance. Prepared rows in email, subject, and body columns should pass validate CSV before emailing so queue workers spend quota on intentional mail only.
Production checklist (3)
Before changing live campaigns, re-verify Gmail sender CONNECTED, scan import issues, confirm suppression imports, and align dailyLimit with Gmail sending limits for CSV guidance. Prepared rows in email, subject, and body columns should pass validate CSV before emailing so queue workers spend quota on intentional mail only.
Sources
Related articles
Gmail
How Does the Gmail API Send an Email?
Send mail with users.messages.send by building RFC 5322 MIME, base64url-encoding raw, and posting through OAuth—exactly how CSV Sender delivers each CSV row.
Gmail
Gmail OAuth for Sending Email: Scopes, Security, and CSV Workflows
Understand Google OAuth for Gmail send-only access, why CSV Sender requests gmail.send, and how tokens stay encrypted at rest.
Gmail
What Is the Gmail API?
The Gmail API is Google’s HTTPS JSON interface for mailbox operations. CSV Sender uses only users.messages.send with OAuth—not SMTP or inbox reads.
CSV Email
Send a CSV Through Gmail Safely
Connect Gmail to a prepared-message CSV workflow, avoid risky Bcc habits, and pace delivery within Google sending limits.