Tools: Best CLI Email Tools Compared: mutt vs mailx vs msmtp vs Nylas CLI - 2025 Update

Tools: Best CLI Email Tools Compared: mutt vs mailx vs msmtp vs Nylas CLI - 2025 Update

The five tools

mailx (BSD Mail / Heirloom mailx)

mutt / NeoMutt

swaks (Swiss Army Knife for SMTP)

Nylas CLI

Feature comparison

When to use which

Quick examples with Nylas CLI

Send email (any provider)

List and search inbox

Calendar management

Give AI agents email access

Extract OTP codes

GPG encrypted email

PowerShell support You want to send email from a script. Or read your inbox without leaving the terminal. Or automate calendar invites from a cron job. The Unix ecosystem has tools for this — mailx, mutt, msmtp, swaks — but each one covers a different slice of the problem. None handles modern OAuth for Gmail or Microsoft 365 out of the box. None outputs JSON for scripting. None touches calendar or contacts. Here's how they compare, and where Nylas CLI fits in. The classic Unix mail command, standardized in POSIX.2. Available on virtually every POSIX system. Sends via local MTA or SMTP relay. Simple but limited: no OAuth, no JSON, minimal attachment support. A powerful terminal mail client with a full TUI. Supports IMAP, POP3, SMTP, GPG, and extensive .muttrc customization. Excellent for power users who want to read mail interactively. Less suited for scripting. A lightweight SMTP client that acts as a sendmail replacement. Does one thing well: relay messages to an SMTP server. Supports TLS and multiple accounts. No reading, no IMAP, no search. A purpose-built SMTP testing tool. Lets you craft raw SMTP sessions with full protocol control. Perfect for testing mail server configs and debugging delivery. A modern CLI that connects to Gmail, Outlook, Exchange, Yahoo, iCloud, and any IMAP provider through OAuth. Provides email, calendar, and contacts in one tool. JSON output for scripting. Built-in MCP server for AI agents. New to it? The getting started guide takes under a minute. Use mailx when you need to fire off a quick notification from a cron job on a system where Postfix or sendmail is already configured. It's everywhere and requires zero setup. Use mutt when you want to read, organize, and reply to email interactively in your terminal. It's the Vim of email clients — steep learning curve, unmatched power once you know it. Use msmtp when you need a lightweight sendmail replacement. Pair it with mutt or mailx for a complete setup. Great for systems that need to relay mail without a full MTA. Use swaks when you're debugging SMTP delivery, testing SPF/DKIM/DMARC configurations, or verifying mail server connectivity. It's a diagnostic tool, not a daily driver. For more on email deliverability debugging, see SPF, DKIM, DMARC: Debug Email Deliverability from the Terminal. Use Nylas CLI when you need multi-provider OAuth (Gmail, Outlook, Exchange, Yahoo, iCloud, IMAP), JSON output for scripting, calendar and contacts alongside email, or AI agent integration via MCP. Full guide: Send Email from the Command Line Provider-specific guides: Full guide: Manage Calendar from the Terminal One command gives Claude Code, Cursor, or Codex full email and calendar tools via MCP. Setup guide: Give Your AI Agent an Email Address Full guide: Extract OTP Codes from Email Full guide: GPG Encrypted Email from the CLI All commands work in PowerShell too. Dedicated guides: Full comparison with code examples for each tool: Best CLI Email Tools Compared All guides: cli.nylas.com/guides Templates let you quickly answer FAQs or store snippets for re-use. Are you sure you want to ? It will become hidden in your post, but will still be visible via the comment's permalink. Hide child comments as well For further actions, you may consider blocking this person and/or reporting abuse

Code Block

Copy

echo "Build failed" | mailx -s "CI Alert" [email protected] echo "Build failed" | mailx -s "CI Alert" [email protected] echo "Build failed" | mailx -s "CI Alert" [email protected] mutt -s "Report" -a report.pdf -- [email protected] < body.txt mutt -s "Report" -a report.pdf -- [email protected] < body.txt mutt -s "Report" -a report.pdf -- [email protected] < body.txt echo -e "Subject: Test\n\nHello" | msmtp [email protected] echo -e "Subject: Test\n\nHello" | msmtp [email protected] echo -e "Subject: Test\n\nHello" | msmtp [email protected] swaks --to [email protected] --server smtp.example.com --tls swaks --to [email protected] --server smtp.example.com --tls swaks --to [email protected] --server smtp.example.com --tls brew install nylas/nylas-cli/nylas nylas auth login nylas email send --to [email protected] --subject "Hello" --body "From the CLI" brew install nylas/nylas-cli/nylas nylas auth login nylas email send --to [email protected] --subject "Hello" --body "From the CLI" brew install nylas/nylas-cli/nylas nylas auth login nylas email send --to [email protected] --subject "Hello" --body "From the CLI" nylas email send \ --to "[email protected]" \ --subject "Quarterly report" \ --body "Please review before Friday." \ --yes nylas email send \ --to "[email protected]" \ --subject "Quarterly report" \ --body "Please review before Friday." \ --yes nylas email send \ --to "[email protected]" \ --subject "Quarterly report" \ --body "Please review before Friday." \ --yes nylas email list --unread --limit 10 nylas email search "invoice" --json | jq '.[].subject' nylas email list --unread --limit 10 nylas email search "invoice" --json | jq '.[].subject' nylas email list --unread --limit 10 nylas email search "invoice" --json | jq '.[].subject' nylas calendar list --limit 5 nylas calendar create --title "Standup" --when "tomorrow 10am" --duration 30m nylas calendar list --limit 5 nylas calendar create --title "Standup" --when "tomorrow 10am" --duration 30m nylas calendar list --limit 5 nylas calendar create --title "Standup" --when "tomorrow 10am" --duration 30m nylas mcp install --assistant claude-code nylas mcp install --assistant claude-code nylas mcp install --assistant claude-code nylas otp get # => ✓ Found code: 847291 (copied to clipboard) nylas otp get # => ✓ Found code: 847291 (copied to clipboard) nylas otp get # => ✓ Found code: 847291 (copied to clipboard) nylas email send --to [email protected] --subject "Contract" --body "..." --sign --encrypt nylas email send --to [email protected] --subject "Contract" --body "..." --sign --encrypt nylas email send --to [email protected] --subject "Contract" --body "..." --sign --encrypt - List Gmail Emails - List Outlook Emails - List Exchange Emails - List Yahoo Emails - List iCloud Emails - Send Email from PowerShell - Replace Send-MailMessage (it's deprecated) - Read and Search Email in PowerShell - Office 365 Email from PowerShell - E2E Email Testing with Playwright - Build an AI Email Triage Agent - AI Agent Audit Logs - Why the Gmail API Breaks AI Agents - Email APIs for AI Agents Compared - CRM Email Workflows - Secure Email Handling for CLI