Command
nylas email drafts create
Create a new draft email with optional attachments.
Written by Qasim Muhammad Staff SRE
What does nylas email drafts create do?
The nylas email drafts create command saves a draft instead of sending it, so an AI agent can stage a reply for human review. It works across Gmail, Outlook, Exchange, Yahoo, iCloud, and IMAP, and returns the draft ID with --json.
Usage
nylas email drafts create --to EMAIL --subject TEXT --body TEXT [--json]Flags
| Flag | Description |
|---|---|
| --json | Output as JSON |
| --no-color | Disable color output |
| --verbose(-v) | Enable verbose output |
| --config | Custom config file path |
| --help(-h) | Show help for the command |
| --limit | Limit results (most list commands) |
| --yes(-y) | Skip confirmations |
| --to(-t) | Recipient email addresses |
| --subject(-s) | Email subject |
| --body(-b) | Email body |
| --cc | CC email addresses |
| --attach(-a) | File paths to attach |
| --reply-to | Message ID to reply to |
| --signature-id | Stored signature ID to append when creating the draft |
Examples
Stage a draft for human review
nylas email drafts create --to customer@example.com --subject "Re: your order" --body "Thanks for reaching out."Create a draft and capture its ID
nylas email drafts create --to customer@example.com --subject "Re: your order" --body "On it." --json | jq -r '.id'Example output
✓ Draft created
Draft ID: draft_abc123
To: alice@example.com
Subject: Q3 planningTroubleshooting
Draft created but not visible in webmail
Some providers sync drafts on a delay. Run nylas email drafts list --json to confirm the draft exists by ID.
Attachment rejected
Pass a readable local file path to --attach and stay within the provider's attachment size limit (25 MB on Gmail).
Recommended guides
List Fastmail emails from the CLI
List Fastmail emails from the CLI through Nylas IMAP access, using app passwords, inbox filters, JSON output, and Fastmail-specific auth troubleshooting.
Why Cloud Servers Block SMTP Ports
AWS, GCP, and Azure block outbound SMTP port 25 while ports 587 and 465 stay open. Confirm the block and send email over an HTTPS API instead.
Send Email From a Docker Container
Cloud providers block SMTP port 25 from containers. Send email over an HTTPS API on port 443 with one command and no mail daemon at all.
MailerSend vs Nylas: Email Compared
MailerSend sends transactional email from verified domains. Nylas reads and syncs user inboxes across 6 providers. Compare features, pricing, and use cases.
Customer.io vs Nylas: Email Compared
Customer.io sends lifecycle emails to your user base. Nylas reads and sends from real user inboxes via OAuth. Compare use cases, pricing, and AI agent support.
Knock vs Nylas: Notifications vs Email API
Knock delivers multi-channel product notifications via workflows; Nylas provides two-way email and calendar sync. Compare scope, pricing, and agent support.
Run nylas email drafts create --help for full help output.