Gmail
How MIME Email Works
Published 2026-09-20 · CSV Sender
Understand MIME structure—headers, multipart/alternative, base64 bodies—and how CSV Sender builds raw messages for users.messages.send without attachments in MVP.
Quick answer
MIME (Multipurpose Internet Mail Extensions) is the text format email systems use to package headers and body parts. CSV Sender builds a raw MIME string per prepared row, encodes it for Gmail API users.messages.send, and does not attach files in the MVP—only text/plain and text/html alternatives derived from your CSV body column (email body in CSV).
Headers operators care about
Typical MIME messages include:
From— connected Gmail address (optional display name)To— recipientemailcellSubject— UTF-8 encoded when non-ASCII (gmail UTF-8 email)MIME-Version: 1.0Content-Type— oftenmultipart/alternativewhen both plain and HTML exist
Optional product headers like Reply-To or List-Unsubscribe may appear when configured—see how it works.
multipart/alternative in CSV Sender
Gmail clients prefer messages with both plain and HTML parts. CSV Sender supplies plain text from CSV and generates HTML by escaping and converting newlines to <br> unless you provide HTML separately (plain text vs HTML email). Boundaries separate parts; each part uses base64 content transfer encoding for UTF-8 safety.
Why Gmail API wants raw MIME
Unlike SMTP dot-stuffing in old scripts, the Gmail API accepts a base64url-encoded raw message (sources). CSV Sender’s pipeline: row → MIME builder → encode → API call (gmail API send email). Status transitions (SCHEDULED → SENT) happen in the database, not in MIME.
Attachments: intentionally out of scope for MVP
Many mail-merge tools attach PDFs or images. CSV Sender MVP focuses on prewritten text outreach—no multipart/mixed attachment trees. If you need files, link to hosted assets inside the HTML part you control in CSV copy, or use a different tool for attachment-heavy blasts.
Debugging MIME issues
Symptoms:
- Garbled characters → encoding; read UTF-8 CSV email.
- Broken layout → HTML escaping rules (multiline text in CSV).
- Empty body → validation should catch missing
body(validate CSV before emailing).
FAQ
Does MIME include my OAuth token?
No—tokens are HTTP Authorization headers separate from MIME.
Can I paste raw MIME into CSV?
No—CSV rows supply logical fields; the app builds MIME.
Will CSV Sender add inline images?
Not in MVP—use linked images in HTML if needed.
Is base64 required?
CSV Sender uses base64 transfer encoding for UTF-8 parts per builder implementation.
Official send guide?
Google’s sending guide in sources.
Related reading
Operational notes for CSV Sender operators
Campaign operators reviewing mime email explained should keep the product model in mind: CSV Sender is CSV in, Gmail out. Each row is a finished email, subject, and body—not a CRM record, not a merge template, and not an AI drafting surface. Before changing production settings, export a dated CSV snapshot so compliance can compare what was approved versus what Gmail actually transmitted (workspace email history).
When in doubt, slow down sends instead of forcing volume. Paced email sending, daily email sending limit, and spread emails throughout the day exist so consumer and Workspace mailboxes are not treated like bulk ESP infrastructure. Pair conservative caps with validate CSV before emailing so FAILED rows reflect real Gmail or data problems—not preventable formatting mistakes (format CSV for email sending).
Auth issues should be fixed before debating CSV content. A disconnected sender (Gmail sender disconnected) makes every downstream symptom look like a scheduling bug. Reconnect OAuth (Gmail reconnect app), confirm gmail.send scope (gmail send scope), then resume RUNNING campaigns (resume email queue). If the platform auto-paused your campaign, read the pause reason in email activity log before blindly re-uploading the same file.
Duplicate and suppression hygiene is not optional for repeat outreach. Import-time dedupe and workspace skips mark SKIPPED rows (duplicate recipients skipped); suppression marks UNSUBSCRIBED (email suppressed meaning). Both differ from FAILED (failed vs skipped email). Teaching stakeholders that distinction prevents bad "retry everything" decisions after a campaign finishes.
Finally, treat internal links as part of your runbook: send emails from CSV orients new users; CSV to Gmail workflow sequences export → validate → send; CSV email sending checklist is the printable preflight. Slug mime-email-explained should be read in that broader system—not as an isolated SEO page.
Security and Gmail API alignment
CSV Sender’s Gmail integration is intentionally narrow: OAuth scopes are limited to sending via gmail.send (gmail OAuth scopes), MIME is assembled per row without reading existing threads (MIME email explained), and tokens are refreshed server-side so operators are not asked to paste access tokens into spreadsheets. When security teams ask whether the product can exfiltrate mail, point them to send Gmail without reading inbox and Google’s official scope documentation linked from article sources where present.
Rate limiting and errors are handled as queue semantics—not silent drops. Retryable Gmail responses reschedule rows (email send retries); repeated failures may pause campaigns (email campaign auto-pause). This is preferable to ad-hoc scripts that re-fire sendEmail in tight loops and double-deliver (email queue duplicates).
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
Plain Text vs HTML Email for Automated Sending
CSV Sender stores plain body text per row and builds multipart/alternative MIME with generated HTML. Learn when plain is enough and how escaping affects layout.
Gmail
How Gmail Handles UTF-8 Subjects and Messages
Send international characters from CSV rows through Gmail API. CSV Sender UTF-8-encodes subjects and bodies in MIME with encoded-word headers where needed.
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.