office365_send_email
Send email from a Microsoft 365 mailbox using the Graph API, supporting HTML content, attachments, and CC/BCC recipients.
Instructions
Send an email through Microsoft 365 via the Microsoft Graph API.
Uses the app-only (client-credentials) OAuth2 flow, so no user is signed in;
mail is sent from the mailbox given by sender or the O365_SENDER env var.
Supports plain-text or HTML bodies, CC/BCC, and local file attachments.
Args: params (SendEmailInput): Validated parameters containing: - to (list[str]): Primary recipient addresses (required). - subject (str): Subject line (required). - body (str): Body content, plain text or HTML (required). - is_html (bool): Treat body as HTML when true (default False). - cc (Optional[list[str]]): CC recipients. - bcc (Optional[list[str]]): BCC recipients. - sender (Optional[str]): From mailbox; overrides O365_SENDER. - attachments (Optional[list[str]]): Local file paths (<~3 MB total). - save_to_sent_items (bool): Keep a Sent Items copy (default True).
Returns: str: A human-readable confirmation, e.g. "Email sent from finance@contoso.com to 2 recipient(s): 'Subject'." On failure, a string beginning with "Error: " describing the problem and how to fix it (auth, permissions, mailbox, rate limits, etc.).
Examples: - "Email the Q3 report to alice@contoso.com" -> to=['alice@contoso.com'], subject='Q3 report', body='...', attachments=['/path/q3.pdf']. - Don't use to read or search mail; this tool only sends.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| params | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |