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 sentDisplays a list of your most recently sent emails with preview information.
Command-Line Flags
Basic Options
| Flag | Short | Type | Default | Description | Example |
|---|---|---|---|---|---|
--account | string | Account email to use (defaults to configured account) | mailos sent --account value | ||
--days | int | 0 | Show sent emails from last N days | mailos sent --days value | |
--number | -n | int | 10 | Number of sent emails to read | mailos sent --number value |
--subject | string | Filter by subject | mailos sent --subject value | ||
--to | string | Filter by recipient | mailos sent --to value |
Advanced Options
| Flag | Short | Type | Default | Description | Example |
|---|---|---|---|---|---|
--range | string | Time range (e.g., 'Last hour', 'Today', 'Yesterday', 'This week') | mailos sent --range value |
Output Options
| Flag | Short | Type | Default | Description | Example |
|---|---|---|---|---|---|
--json | bool | false | Output as JSON | mailos sent --json | |
--output-dir | string | resolved MailOS sent storage | Directory to save markdown files | mailos sent --output-dir value | |
--save-markdown | bool | true | Save emails as markdown files | mailos sent --save-markdown |
Examples
View Recent Sent Emails
bash
# Show last 10 sent emails
mailos sent
# Show last 20 sent emails
mailos sent -n 20Filter 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 30Output 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-emailsMulti-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
--jsonflag for programmatic access to sent email data - Combine filters for more precise results:
mailos sent --to [email protected] --days 14 - The
--daysfilter 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 authcommand 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.
