Skip to content

EmailOS Sent Command Documentation

The mailos sent command retrieves and displays emails from your sent folder, allowing you to view emails you have previously sent.

Basic Usage

bash
mailos sent

Displays a list of your most recently sent emails with preview information.

Command-Line Flags

Basic Options

FlagShortTypeDefaultDescriptionExample
--accountstringAccount email to use (defaults to configured account)mailos sent --account value
--daysint0Show sent emails from last N daysmailos sent --days value
--number-nint10Number of sent emails to readmailos sent --number value
--subjectstringFilter by subjectmailos sent --subject value
--tostringFilter by recipientmailos sent --to value

Advanced Options

FlagShortTypeDefaultDescriptionExample
--rangestringTime range (e.g., 'Last hour', 'Today', 'Yesterday', 'This week')mailos sent --range value

Output Options

FlagShortTypeDefaultDescriptionExample
--jsonboolfalseOutput as JSONmailos sent --json
--output-dirstringresolved MailOS sent storageDirectory to save markdown filesmailos sent --output-dir value
--save-markdownbooltrueSave emails as markdown filesmailos sent --save-markdown

Examples

View Recent Sent Emails

bash
# Show last 10 sent emails
mailos sent

# Show last 20 sent emails
mailos sent -n 20

Filter by Recipient

bash
# Show emails sent to a specific person
mailos sent --to [email protected]

# Show emails sent to multiple people (search in To field)
mailos sent --to "@company.com"

Filter by Subject

bash
# Find sent emails about meetings
mailos sent --subject "meeting"

# Find sent emails with specific project name
mailos sent --subject "Project Alpha"

Filter by Time Period

bash
# Show emails sent in the last 7 days
mailos sent --days 7

# Show emails sent in the last 30 days
mailos sent --days 30

Output Formats

bash
# Get results in JSON format for scripting
mailos sent --json > sent-emails.json

# Disable markdown file saving
mailos sent --save-markdown=false

# Save to custom directory
mailos sent --output-dir ./my-sent-emails

Multi-Account Usage

bash
# Use specific account
mailos sent --account [email protected]

# View sent emails from personal account
mailos sent --account [PERSONAL_ACCOUNT]

Output Format

The command displays sent emails with the following information:

  • Email number (for reference)
  • From address (your sending address)
  • To address(es) (recipients)
  • Subject line
  • Date sent
  • Email preview (first 100 characters)
  • Attachment information (if any)
  • Link to open email in desktop mail app

Markdown File Storage

By default, sent emails are automatically saved as markdown files in ~/.email/sent/. If the nearest emailos.toml or emailos.json sets local_storage = true, they are saved under that config folder's .email/sent/ directory instead. Each file contains:

  • Email subject as heading
  • Sender and recipient information
  • Date sent
  • Full email body content

Integration with Other Commands

The sent command works well with other EmailOS commands:

bash
# Search for specific sent emails first
mailos sent --subject "invoice" --days 30

# Open a specific sent email in your mail app
mailos open --id [email_id]

Tips

  • Use the --json flag for programmatic access to sent email data
  • Combine filters for more precise results: mailos sent --to [email protected] --days 14
  • The --days filter is often more practical than specific date ranges
  • Markdown files are automatically organized by date for easy reference
  • Use the account flag when managing multiple email accounts

Troubleshooting

Common Issues

"No sent emails found"

  • Check if your email provider uses a different sent folder name
  • Verify you have sent emails in the specified time period
  • Try without filters to see if any sent emails are accessible

"Authentication failed"

  • Ensure your email configuration is correct
  • Verify your app-specific password is valid
  • Try the mailos auth command to re-authenticate

"Failed to connect to IMAP server"

  • Check your internet connection
  • Verify IMAP settings for your email provider
  • Some providers require specific IMAP configurations

For additional help, see the main EmailOS documentation or use mailos help sent.

Released under the MIT License.