Outlook 365 — Send
Outlook 365 — Send
Section titled “Outlook 365 — Send”Type: outlook365-send · Package: Outlook 365 v1.0.5 · Output: —
Sends a new email from the session’s mailbox. It supports several recipients, Cc and Bcc, a plain-text or HTML body and file attachments. The email is saved in Sent Items, just as if you had sent it from Outlook.
How it works
Section titled “How it works”It works on the session created with Outlook 365 — Connect. Pass it in the session parameter, or place this activity inside the body of Outlook 365 — Connect to inherit it automatically.
- Recipients: in
to,ccandbcc, write the addresses as text separated by commas or semicolons ("ana@example.com; luis@example.com"), or pass a list of addresses directly (recipients). Since version 1.0.5; before, a list made the send fail. - Body: if you turn on
isHtml,bodyis sent as HTML; otherwise as plain text. - Attachments: each path must exist on the machine where the robot runs; the file is attached with its own name. All files are read before sending: if one is missing, nothing is sent.
- Sender: the email is sent from the session’s mailbox. To send from a shared mailbox, connect with
mailboxand make sure the account has Send As permission on it.
Required parameters
Section titled “Required parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
to | string | List | — | Recipient(s): text with the addresses separated by commas or semicolons, or a list of addresses (list since version 1.0.5). |
Optional parameters
Section titled “Optional parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
session | ZoanOutlookMailSession | — | Outlook 365 — Connect session (inherited inside body). |
cc | string | List | — | Cc recipient(s): text separated by commas or semicolons, or a list. |
bcc | string | List | — | Bcc recipient(s): text separated by commas or semicolons, or a list. |
subject | string | "" | Email subject. |
body | string | "" | Email body (plain text or HTML). |
isHtml | bool | false | If true, the body is interpreted as HTML. |
attachments | string | List | — | A file path, several paths separated by commas or semicolons, or a list of paths. |
Output
Section titled “Output”This activity does not return a value. Microsoft Graph does not return the sent email’s ID; if you need it, look it up afterwards in sentitems with Get emails.
Common errors
Section titled “Common errors”| Message | Cause and fix |
|---|---|
'to' is required. | to is empty or the expression returned null. |
Attachment file not found. | A path in attachments does not exist on the robot’s machine. Check it with File Exists before sending. |
Graph error ErrorInvalidRecipients | An address in to/cc/bcc is invalid. Check the text or the list items. |
Graph error ErrorSendAsDenied / ErrorAccessDenied | The account cannot send from that mailbox, or the connection lacks the Mail.Send permission. |
| Graph error about the request size | The attachments exceed the request limit. Send a link instead. |
Example
Section titled “Example”Outlook 365 — Connect credential = credential("m365-reports") └─ body: Excel to PDF path = "C:\reports\sales.xlsx" → output: pdf Outlook 365 — Send to = "management@example.com; finance@example.com" cc = "audit@example.com" subject = "Sales report" body = "<p>Please find today's report attached.</p>" isHtml = true attachments = pdfRelated activities
Section titled “Related activities”- Outlook 365 — Connect — open the session.
- Outlook 365 — Reply — reply within a thread.
- Outlook 365 — Forward — forward an email.
- All Outlook 365 activities