outlook

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Outlook Email & Calendar

Outlook 邮件与日历

Access Microsoft 365 Outlook email and calendar via Microsoft Graph API.
通过Microsoft Graph API访问Microsoft 365 Outlook邮件和日历。

Prerequisites

前置条件

  • Credentials configured in
    ~/.outlook/
    (run setup if not done)
  • Azure CLI, jq, curl installed
Note: Tokens are automatically refreshed when needed. No manual intervention required.
  • 已在
    ~/.outlook/
    中配置凭据(未配置请运行设置脚本)
  • 已安装Azure CLI、jq、curl
注意: 令牌会在需要时自动刷新,无需手动干预。

Email Operations

邮件操作

Reading Email

查看邮件

bash
undefined
bash
undefined

List inbox (default 10 messages)

List inbox (default 10 messages)

~/.claude/skills/outlook/scripts/outlook-mail.sh inbox
~/.claude/skills/outlook/scripts/outlook-mail.sh inbox

List more messages

List more messages

~/.claude/skills/outlook/scripts/outlook-mail.sh inbox 25
~/.claude/skills/outlook/scripts/outlook-mail.sh inbox 25

Unread only

Unread only

~/.claude/skills/outlook/scripts/outlook-mail.sh unread
~/.claude/skills/outlook/scripts/outlook-mail.sh unread

Focused inbox only

Focused inbox only

~/.claude/skills/outlook/scripts/outlook-mail.sh focused
~/.claude/skills/outlook/scripts/outlook-mail.sh focused

List sent items (your sent emails)

List sent items (your sent emails)

~/.claude/skills/outlook/scripts/outlook-mail.sh sent ~/.claude/skills/outlook/scripts/outlook-mail.sh sent 25
~/.claude/skills/outlook/scripts/outlook-mail.sh sent ~/.claude/skills/outlook/scripts/outlook-mail.sh sent 25

List messages from any folder by name (searches recursively)

List messages from any folder by name (searches recursively)

~/.claude/skills/outlook/scripts/outlook-mail.sh folder "Chawton Hector" 20
~/.claude/skills/outlook/scripts/outlook-mail.sh folder "Chawton Hector" 20

Filter by sender

Filter by sender

~/.claude/skills/outlook/scripts/outlook-mail.sh from "john@example.com"
~/.claude/skills/outlook/scripts/outlook-mail.sh from "john@example.com"

Search emails

Search emails

~/.claude/skills/outlook/scripts/outlook-mail.sh search "project update"
~/.claude/skills/outlook/scripts/outlook-mail.sh search "project update"

Read full message (use ID from list)

Read full message (use ID from list)

~/.claude/skills/outlook/scripts/outlook-mail.sh read <message-id>
~/.claude/skills/outlook/scripts/outlook-mail.sh read <message-id>

Quick preview (subject, from, date, body preview)

Quick preview (subject, from, date, body preview)

~/.claude/skills/outlook/scripts/outlook-mail.sh preview <message-id>
undefined
~/.claude/skills/outlook/scripts/outlook-mail.sh preview <message-id>
undefined

Sending Email

发送邮件

bash
undefined
bash
undefined

Create plain text draft

Create plain text draft

~/.claude/skills/outlook/scripts/outlook-mail.sh draft "recipient@example.com" "Subject" "Body text"
~/.claude/skills/outlook/scripts/outlook-mail.sh draft "recipient@example.com" "Subject" "Body text"

Create markdown-formatted draft (converts to HTML)

Create markdown-formatted draft (converts to HTML)

~/.claude/skills/outlook/scripts/outlook-mail.sh mddraft "recipient@example.com" "Subject" "Bold and italic text"
~/.claude/skills/outlook/scripts/outlook-mail.sh mddraft "recipient@example.com" "Subject" "Bold and italic text"

Send a draft (use draft ID)

Send a draft (use draft ID)

~/.claude/skills/outlook/scripts/outlook-mail.sh send <draft-id>
~/.claude/skills/outlook/scripts/outlook-mail.sh send <draft-id>

Reply to a message (plain text - creates draft)

Reply to a message (plain text - creates draft)

~/.claude/skills/outlook/scripts/outlook-mail.sh reply <message-id> "Reply body"
~/.claude/skills/outlook/scripts/outlook-mail.sh reply <message-id> "Reply body"

Reply with markdown formatting (converts to HTML - creates draft)

Reply with markdown formatting (converts to HTML - creates draft)

~/.claude/skills/outlook/scripts/outlook-mail.sh mdreply <message-id> "Bold reply with formatting"
~/.claude/skills/outlook/scripts/outlook-mail.sh mdreply <message-id> "Bold reply with formatting"

Send reply draft

Send reply draft

~/.claude/skills/outlook/scripts/outlook-mail.sh send <reply-draft-id>
~/.claude/skills/outlook/scripts/outlook-mail.sh send <reply-draft-id>

Follow up on your own sent email (chaser)

Follow up on your own sent email (chaser)

~/.claude/skills/outlook/scripts/outlook-mail.sh followup <sent-message-id> ~/.claude/skills/outlook/scripts/outlook-mail.sh followup <sent-message-id> "Custom follow-up body in markdown"
~/.claude/skills/outlook/scripts/outlook-mail.sh followup <sent-message-id> ~/.claude/skills/outlook/scripts/outlook-mail.sh followup <sent-message-id> "Custom follow-up body in markdown"

Update an existing draft

Update an existing draft

~/.claude/skills/outlook/scripts/outlook-mail.sh update <draft-id> subject "New subject line" ~/.claude/skills/outlook/scripts/outlook-mail.sh update <draft-id> body "Plain text body" ~/.claude/skills/outlook/scripts/outlook-mail.sh update <draft-id> mdbody "Markdown body" ~/.claude/skills/outlook/scripts/outlook-mail.sh update <draft-id> to "new-recipient@example.com" ~/.claude/skills/outlook/scripts/outlook-mail.sh update <draft-id> cc "cc@example.com" ~/.claude/skills/outlook/scripts/outlook-mail.sh update <draft-id> bcc "bcc@example.com"
~/.claude/skills/outlook/scripts/outlook-mail.sh update <draft-id> subject "New subject line" ~/.claude/skills/outlook/scripts/outlook-mail.sh update <draft-id> body "Plain text body" ~/.claude/skills/outlook/scripts/outlook-mail.sh update <draft-id> mdbody "Markdown body" ~/.claude/skills/outlook/scripts/outlook-mail.sh update <draft-id> to "new-recipient@example.com" ~/.claude/skills/outlook/scripts/outlook-mail.sh update <draft-id> cc "cc@example.com" ~/.claude/skills/outlook/scripts/outlook-mail.sh update <draft-id> bcc "bcc@example.com"

List drafts

List drafts

~/.claude/skills/outlook/scripts/outlook-mail.sh drafts

**Note:** `mddraft`, `mdreply`, and `update mdbody` require `pandoc` for markdown conversion. Install with `brew install pandoc` (macOS) or `apt install pandoc` (Linux).

**IMPORTANT:** Always prefer `mdreply` over `reply` for professional emails - plain text replies look poorly formatted in Outlook.
~/.claude/skills/outlook/scripts/outlook-mail.sh drafts

**注意:** `mddraft`、`mdreply`和`update mdbody`命令需要`pandoc`进行markdown格式转换。可通过`brew install pandoc`(macOS)或`apt install pandoc`(Linux)安装。

**重要提示:** 发送专业邮件时请优先使用`mdreply`而非`reply`——纯文本回复在Outlook中显示格式较差。

Attachments

附件操作

Reading attachments:
bash
undefined
查看附件:
bash
undefined

List attachments on a message

List attachments on a message

~/.claude/skills/outlook/scripts/outlook-mail.sh attachments <message-id>
~/.claude/skills/outlook/scripts/outlook-mail.sh attachments <message-id>

Download ALL attachments to ./inbox/

Download ALL attachments to ./inbox/

~/.claude/skills/outlook/scripts/outlook-mail.sh download <message-id>
~/.claude/skills/outlook/scripts/outlook-mail.sh download <message-id>

Download specific attachment

Download specific attachment

~/.claude/skills/outlook/scripts/outlook-mail.sh download <message-id> <attachment-id>

**Adding attachments to drafts:**
```bash
~/.claude/skills/outlook/scripts/outlook-mail.sh download <message-id> <attachment-id>

**为草稿添加附件:**
```bash

Add attachment to a draft (supports files up to 150MB)

Add attachment to a draft (supports files up to 150MB)

~/.claude/skills/outlook/scripts/outlook-mail.sh attach <draft-id> <file-path>

Upload method is automatic based on file size:
- **Small files (< 3MB):** Direct base64 upload - instant
- **Large files (3MB - 150MB):** Chunked upload with progress indicator

Multiple attachments can be added by calling `attach` multiple times on the same draft.
~/.claude/skills/outlook/scripts/outlook-mail.sh attach <draft-id> <file-path>

上传方式会根据文件大小自动选择:
- **小文件(<3MB):** 直接base64上传——即时完成
- **大文件(3MB-150MB):** 分块上传并显示进度指示器

可多次调用`attach`命令为同一草稿添加多个附件。

Email Management

邮件管理

bash
undefined
bash
undefined

Mark as read

Mark as read

~/.claude/skills/outlook/scripts/outlook-mail.sh markread <message-id>
~/.claude/skills/outlook/scripts/outlook-mail.sh markread <message-id>

Mark as unread

Mark as unread

~/.claude/skills/outlook/scripts/outlook-mail.sh markunread <message-id>
~/.claude/skills/outlook/scripts/outlook-mail.sh markunread <message-id>

Delete

Delete

~/.claude/skills/outlook/scripts/outlook-mail.sh delete <message-id>
~/.claude/skills/outlook/scripts/outlook-mail.sh delete <message-id>

Archive

Archive

~/.claude/skills/outlook/scripts/outlook-mail.sh archive <message-id>
~/.claude/skills/outlook/scripts/outlook-mail.sh archive <message-id>

Move to any folder (searches by name, supports nested folders)

Move to any folder (searches by name, supports nested folders)

~/.claude/skills/outlook/scripts/outlook-mail.sh move <message-id> "Projects" ~/.claude/skills/outlook/scripts/outlook-mail.sh move <message-id> "Clients/Acme"
undefined
~/.claude/skills/outlook/scripts/outlook-mail.sh move <message-id> "Projects" ~/.claude/skills/outlook/scripts/outlook-mail.sh move <message-id> "Clients/Acme"
undefined

Folder Management

文件夹管理

bash
undefined
bash
undefined

List top-level folders

List top-level folders

~/.claude/skills/outlook/scripts/outlook-mail.sh folders
~/.claude/skills/outlook/scripts/outlook-mail.sh folders

List subfolders of a folder (default: inbox)

List subfolders of a folder (default: inbox)

~/.claude/skills/outlook/scripts/outlook-mail.sh subfolders ~/.claude/skills/outlook/scripts/outlook-mail.sh subfolders "Important"
~/.claude/skills/outlook/scripts/outlook-mail.sh subfolders ~/.claude/skills/outlook/scripts/outlook-mail.sh subfolders "Important"

Create a new top-level folder

Create a new top-level folder

~/.claude/skills/outlook/scripts/outlook-mail.sh mkdir "Projects"
~/.claude/skills/outlook/scripts/outlook-mail.sh mkdir "Projects"

Create a subfolder under an existing folder

Create a subfolder under an existing folder

~/.claude/skills/outlook/scripts/outlook-mail.sh mkdir "Acme" "Clients" ~/.claude/skills/outlook/scripts/outlook-mail.sh mkdir "Urgent" inbox
~/.claude/skills/outlook/scripts/outlook-mail.sh mkdir "Acme" "Clients" ~/.claude/skills/outlook/scripts/outlook-mail.sh mkdir "Urgent" inbox

Inbox statistics (total, unread counts)

Inbox statistics (total, unread counts)

~/.claude/skills/outlook/scripts/outlook-mail.sh stats
undefined
~/.claude/skills/outlook/scripts/outlook-mail.sh stats
undefined

Calendar Operations

日历操作

Viewing Calendar

查看日历

bash
undefined
bash
undefined

Upcoming events (default 10)

Upcoming events (default 10)

~/.claude/skills/outlook/scripts/outlook-calendar.sh events
~/.claude/skills/outlook/scripts/outlook-calendar.sh events

Today's events

Today's events

~/.claude/skills/outlook/scripts/outlook-calendar.sh today
~/.claude/skills/outlook/scripts/outlook-calendar.sh today

This week

This week

~/.claude/skills/outlook/scripts/outlook-calendar.sh week
~/.claude/skills/outlook/scripts/outlook-calendar.sh week

Read event details

Read event details

~/.claude/skills/outlook/scripts/outlook-calendar.sh read <event-id>
~/.claude/skills/outlook/scripts/outlook-calendar.sh read <event-id>

List calendars

List calendars

~/.claude/skills/outlook/scripts/outlook-calendar.sh calendars
undefined
~/.claude/skills/outlook/scripts/outlook-calendar.sh calendars
undefined

Creating Events

创建事件

bash
undefined
bash
undefined

Create event (dates in YYYY-MM-DDTHH:MM format)

Create event (dates in YYYY-MM-DDTHH:MM format)

~/.claude/skills/outlook/scripts/outlook-calendar.sh create "Meeting subject" "2025-02-05T14:00" "2025-02-05T15:00" "Conference Room A"
~/.claude/skills/outlook/scripts/outlook-calendar.sh create "Meeting subject" "2025-02-05T14:00" "2025-02-05T15:00" "Conference Room A"

Quick 1-hour event

Quick 1-hour event

~/.claude/skills/outlook/scripts/outlook-calendar.sh quick "Team standup" "2025-02-05T09:00"
undefined
~/.claude/skills/outlook/scripts/outlook-calendar.sh quick "Team standup" "2025-02-05T09:00"
undefined

Availability

可用性查询

bash
undefined
bash
undefined

Check free/busy

Check free/busy

~/.claude/skills/outlook/scripts/outlook-calendar.sh free "2025-02-05T09:00" "2025-02-05T17:00"
undefined
~/.claude/skills/outlook/scripts/outlook-calendar.sh free "2025-02-05T09:00" "2025-02-05T17:00"
undefined

Workflow: Capturing Email to Brain

工作流:将邮件存入知识库

When user wants to capture an email:
  1. List emails to find the one to capture
  2. Read the full message content
  3. Check for attachments with
    attachments
    command
  4. Download any attachments (goes to
    ./inbox/
    )
  5. Create markdown file in brain's
    inbox/
    directory:
markdown
undefined
当用户需要保存邮件时:
  1. 列出邮件找到目标邮件
  2. 读取完整邮件内容
  3. 使用
    attachments
    命令查看附件
  4. 下载所有附件(保存至
    ./inbox/
  5. 在知识库的
    inbox/
    目录创建markdown文件:
markdown
undefined

Email: [Subject]

Email: [Subject]

From: sender@example.com Date: YYYY-MM-DD HH:MM Captured: YYYY-MM-DD
From: sender@example.com Date: YYYY-MM-DD HH:MM Captured: YYYY-MM-DD

Content

Content

[Email body]
[Email body]

Attachments

Attachments

  • [[inbox/filename.pdf]] (captured)
  • [[inbox/filename.pdf]] (captured)

Notes

Notes

[User's annotations]
undefined
[User's annotations]
undefined

Workflow: Processing Email Attachments

工作流:处理邮件附件

When user wants to grab attachments from an email:
  1. Find the email:
    inbox
    ,
    search
    , or
    from
    commands
  2. List attachments:
    attachments <message-id>
  3. Download:
    download <message-id>
    (all) or
    download <message-id> <attachment-id>
    (specific)
  4. Files land in
    ./inbox/
    for processing
  5. User allocates files to appropriate areas during review
当用户需要提取邮件附件时:
  1. 通过
    inbox
    search
    from
    命令找到目标邮件
  2. 使用
    attachments <message-id>
    列出附件
  3. 使用
    download <message-id>
    (全部)或
    download <message-id> <attachment-id>
    (指定)下载附件
  4. 文件将保存至
    ./inbox/
    等待处理
  5. 用户在审阅时将文件分配至对应区域

Workflow: Sending Email

工作流:发送邮件

Always draft first, confirm, then send:
  1. Create draft with
    draft
    or
    mddraft
    command
  2. Show user the draft content
  3. Wait for "send it" or change requests
  4. Update draft if needed
  5. Send with
    send
    command only after explicit approval
请始终先创建草稿、确认内容后再发送:
  1. 使用
    draft
    mddraft
    命令创建草稿
  2. 向用户展示草稿内容
  3. 等待用户“发送”指令或修改请求
  4. 如有需要更新草稿
  5. 仅在获得明确批准后使用
    send
    命令发送

Workflow: Sending Email with Attachments

工作流:发送带附件的邮件

  1. Create draft with
    draft
    or
    mddraft
    command
  2. Add attachments with
    attach <draft-id> <file-path>
    (repeat for multiple files)
  3. Show user the draft details and attached files
  4. Wait for confirmation
  5. Send with
    send
    command only after explicit approval
Example:
bash
undefined
  1. 使用
    draft
    mddraft
    命令创建草稿
  2. 使用
    attach <draft-id> <file-path>
    添加附件(可多次调用添加多个文件)
  3. 向用户展示草稿详情及附件列表
  4. 等待用户确认
  5. 仅在获得明确批准后使用
    send
    命令发送
示例:
bash
undefined

Create draft

Create draft

~/.claude/skills/outlook/scripts/outlook-mail.sh draft "bob@example.com" "Q4 Report" "Please find the report attached."
~/.claude/skills/outlook/scripts/outlook-mail.sh draft "bob@example.com" "Q4 Report" "Please find the report attached."

Output: Draft ID: xxxxxxxxxxxxxxxxxxxx

Output: Draft ID: xxxxxxxxxxxxxxxxxxxx

Attach files (can be called multiple times)

Attach files (can be called multiple times)

~/.claude/skills/outlook/scripts/outlook-mail.sh attach xxxxxxxxxxxxxxxxxxxx /path/to/report.pdf ~/.claude/skills/outlook/scripts/outlook-mail.sh attach xxxxxxxxxxxxxxxxxxxx /path/to/data.xlsx
~/.claude/skills/outlook/scripts/outlook-mail.sh attach xxxxxxxxxxxxxxxxxxxx /path/to/report.pdf ~/.claude/skills/outlook/scripts/outlook-mail.sh attach xxxxxxxxxxxxxxxxxxxx /path/to/data.xlsx

Send after user confirms

Send after user confirms

~/.claude/skills/outlook/scripts/outlook-mail.sh send xxxxxxxxxxxxxxxxxxxx
undefined
~/.claude/skills/outlook/scripts/outlook-mail.sh send xxxxxxxxxxxxxxxxxxxx
undefined

Workflow: Sending Follow-up / Chaser Emails

工作流:发送跟进邮件

When user wants to follow up on an email they sent:
  1. List sent items with
    sent
    command to find the original email
  2. Create follow-up with
    followup <sent-id>
    (uses default message) or provide custom body
  3. Show user the draft content
  4. Wait for confirmation or changes
  5. Send with
    send
    command only after explicit approval
Example:
bash
undefined
当用户需要跟进已发送的邮件时:
  1. 使用
    sent
    命令列出已发送邮件找到原邮件
  2. 使用
    followup <sent-id>
    创建跟进草稿(使用默认内容)或提供自定义正文
  3. 向用户展示草稿内容
  4. 等待用户确认或修改
  5. 仅在获得明确批准后使用
    send
    命令发送
示例:
bash
undefined

Find the original sent email

Find the original sent email

~/.claude/skills/outlook/scripts/outlook-mail.sh sent 20
~/.claude/skills/outlook/scripts/outlook-mail.sh sent 20

Create follow-up draft (default body)

Create follow-up draft (default body)

~/.claude/skills/outlook/scripts/outlook-mail.sh followup abc123xyz
~/.claude/skills/outlook/scripts/outlook-mail.sh followup abc123xyz

Or with custom message

Or with custom message

~/.claude/skills/outlook/scripts/outlook-mail.sh followup abc123xyz "Hi, just checking in on this. Would be great to get your thoughts when you have a moment."
~/.claude/skills/outlook/scripts/outlook-mail.sh followup abc123xyz "Hi, just checking in on this. Would be great to get your thoughts when you have a moment."

Send after user confirms

Send after user confirms

~/.claude/skills/outlook/scripts/outlook-mail.sh send <draft-id>
undefined
~/.claude/skills/outlook/scripts/outlook-mail.sh send <draft-id>
undefined

Workflow: Creating Calendar Events

工作流:创建日历事件

Always confirm before creating:
  1. Parse user's request for: subject, start time, end time, location
  2. Show proposed event details to user
  3. Wait for confirmation or adjustments
  4. Create event only after explicit "yes" / approval
请始终在创建前确认:
  1. 解析用户请求中的主题、开始时间、结束时间、地点
  2. 向用户展示拟创建的事件详情
  3. 等待用户确认或调整
  4. 仅在获得明确“同意”后创建事件

Error Handling

错误处理

  • Token expired: Automatically refreshed on next call
  • Permission denied: Re-run setup to re-consent
  • Network error: Check connectivity, retry
  • 令牌过期: 下次调用时自动刷新
  • 权限拒绝: 重新运行设置脚本以重新授权
  • 网络错误: 检查网络连接后重试

Setup

设置

If not configured, run:
bash
~/.claude/skills/outlook/scripts/outlook-setup.sh
See
references/setup.md
for manual setup instructions.
若未配置,请运行:
bash
~/.claude/skills/outlook/scripts/outlook-setup.sh
如需手动设置,请查看
references/setup.md
中的说明。