Guide

Send Yahoo Mail from the Command Line

Yahoo's SMTP setup requires app-specific passwords, port 465/587 configuration, and constant troubleshooting when Yahoo blocks third-party logins. The Nylas CLI sends Yahoo Mail using OAuth2 through the Nylas API — no SMTP, no app passwords, no smtp.mail.yahoo.com config. Works across Gmail, Outlook, Exchange, Yahoo, iCloud, and IMAP with 72+ commands and built-in OAuth2.

By Pouya Sanooei

The problem with sending Yahoo Mail from terminal

Sending email through Yahoo from the command line normally means configuring SMTP at smtp.mail.yahoo.com on port 465 (SSL) or 587 (TLS). You also need an app-specific password because Yahoo disabled third-party access with regular passwords. Even after setup, Yahoo frequently blocks SMTP logins from unfamiliar locations or IP addresses.

The Nylas CLI skips all of this. It sends through the Nylas API, which handles Yahoo OAuth2 token management and provider routing. Authenticate once, then every nylas email send command works without touching SMTP settings.

1. Install Nylas CLI

# macOS / Linux (Homebrew)
brew install nylas/nylas-cli/nylas

# macOS / Linux / WSL (shell script)
curl -fsSL https://cli.nylas.com/install.sh | bash

# Windows (PowerShell)
irm https://cli.nylas.com/install.ps1 | iex

# From source (requires Go 1.23+)
go install github.com/nylas/cli/cmd/nylas@latest

2. Authenticate your Yahoo account

Create an application at dashboard-v3.nylas.com, connect your Yahoo mailbox, and grab your API key. Then:

nylas auth config
# Paste your API key when prompted

# Verify the connection
nylas auth whoami

The output confirms your Yahoo account is connected:

Authentication Status

Current Account:
  Email: you@yahoo.com
  Provider: yahoo
  Grant ID: a1b2c3d4-e5f6-7890-abcd-ef1234567890
  Status: ✓ Valid

Configuration:
  Region: us
  Config Path: ~/.config/nylas/config.yaml
  Secret Store: system keyring

3. Send a basic email

nylas email send \
  --to "friend@example.com" \
  --subject "Quick update" \
  --body "Hey — just wanted to share the notes from today."

# Skip the confirmation prompt
nylas email send \
  --to friend@example.com \
  --subject "Quick update" \
  --body "Notes attached below." \
  --yes

After sending, the CLI confirms delivery:

✓ Email sent successfully

  Message ID: msg_abc123def456
  To: friend@example.com
  Subject: Quick update
  Sent at: 2026-03-28T10:15:00-04:00

4. Send with attachments

Yahoo allows attachments up to 25 MB per message. Attach one or more files with --attach:

# Single file
nylas email send \
  --to colleague@company.com \
  --subject "Q1 report" \
  --body "See the attached PDF." \
  --attach report.pdf

# Multiple files
nylas email send \
  --to colleague@company.com \
  --subject "Project files" \
  --body "All deliverables attached." \
  --attach design.png \
  --attach spec.pdf \
  --attach budget.xlsx

5. Send HTML email

Use --html to send formatted messages with links, bold text, or inline styles:

nylas email send \
  --to team@company.com \
  --subject "Sprint summary" \
  --html "<h2>Sprint 14 Results</h2><p>Completed <strong>12 of 14</strong> stories.</p><p><a href='https://board.example.com'>View board</a></p>"

6. CC and BCC recipients

nylas email send \
  --to alice@team.com \
  --cc bob@team.com \
  --bcc manager@team.com \
  --subject "Design review feedback" \
  --body "Shared notes from today's review session."

7. Schedule email for later

Queue a message now and let the Nylas API deliver it at the right time:

# Send in 2 hours
nylas email send \
  --to client@example.com \
  --subject "Follow-up" \
  --body "Checking in on the proposal." \
  --schedule 2h

# Send tomorrow morning
nylas email send \
  --to team@company.com \
  --subject "Standup reminder" \
  --body "Don't forget standup at 9:30." \
  --schedule "tomorrow 9am"

# Send on a specific date
nylas email send \
  --to client@example.com \
  --subject "Renewal notice" \
  --body "Your subscription renews next week." \
  --schedule "2026-04-01 08:00"

8. JSON output for scripting

Every command supports --json output. Pipe it into jq or feed it to another tool:

# Send and get structured output
nylas email send \
  --to user@example.com \
  --subject "Automated report" \
  --body "Generated by CI pipeline." \
  --yes --json | jq '.id'

# Bulk send from a CSV
while IFS=, read -r email name; do
  nylas email send \
    --to "$email" \
    --subject "Hi $name" \
    --body "Your account is ready." \
    --yes
  sleep 2
done < contacts.csv

Yahoo SMTP vs Nylas CLI

Here's what changes when you switch from Yahoo's SMTP to the Nylas CLI:

FeatureYahoo SMTPNylas CLI
Server configsmtp.mail.yahoo.com:465None required
AuthenticationApp-specific passwordOAuth2 (automatic)
Token refreshManualAutomatic
Blocked loginsFrequent from new IPsNot applicable
AttachmentsManual MIME encoding--attach file.pdf
HTML emailManual headers--html flag
Scheduled sendNot supported--schedule flag
JSON outputNot supported--json flag
Read inboxSeparate IMAP configSame CLI
Calendar accessNot availableBuilt-in

Yahoo-specific tips

AT&T Yahoo Mail

AT&T email accounts (@att.net, @sbcglobal.net, @bellsouth.net) use Yahoo's infrastructure. Connect them as Yahoo accounts during authentication. The CLI routes through the correct OAuth2 flow automatically.

Verizon Yahoo Mail

Verizon migrated its email service to Yahoo in 2017. Accounts ending in @verizon.net authenticate through Yahoo's OAuth2. No special configuration needed.

Yahoo sending limits

According to Yahoo's sending guidelines, free Yahoo Mail accounts can send to up to 500 recipients per day. Each individual message supports up to 100 recipients across To, CC, and BCC combined. The attachment limit is 25 MB per message. Exceeding these limits triggers a temporary sending block that lasts up to 24 hours.

If you're sending bulk emails from a script, add a sleep 2 between sends to stay well under rate limits.

Yahoo Mail aliases

Yahoo lets you create disposable email addresses (aliases) from your account settings. Emails sent through the Nylas CLI come from your primary Yahoo address. To send from an alias, configure it as a connected identity in the Nylas dashboard.

Next steps