get_emails
Retrieve emails from Apple Mail accounts with standard properties like subject, sender, and date. Specify account, mailbox, and limit to fetch sorted messages.
Instructions
Get emails from a mailbox.
Retrieves emails with standard properties: id, subject, sender, date_received, read status, and flagged status.
Args: account: Account name. Uses JXA_MAIL_DEFAULT_ACCOUNT env var or first account if not specified. mailbox: Mailbox name. Uses JXA_MAIL_DEFAULT_MAILBOX env var or "Inbox" if not specified. limit: Maximum number of emails to return (default: 50)
Returns: List of email dictionaries sorted by date (newest first).
Example: >>> get_emails("Work", "INBOX", limit=10) [{"subject": "Meeting tomorrow", "sender": "boss@work.com", ...}, ...]
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| account | No | ||
| mailbox | No | ||
| limit | No |