Skip to content

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.

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, cc and bcc, 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, body is 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 mailbox and make sure the account has Send As permission on it.
ParameterTypeDefaultDescription
tostring | List—Recipient(s): text with the addresses separated by commas or semicolons, or a list of addresses (list since version 1.0.5).
ParameterTypeDefaultDescription
sessionZoanOutlookMailSession—Outlook 365 — Connect session (inherited inside body).
ccstring | List—Cc recipient(s): text separated by commas or semicolons, or a list.
bccstring | List—Bcc recipient(s): text separated by commas or semicolons, or a list.
subjectstring""Email subject.
bodystring""Email body (plain text or HTML).
isHtmlboolfalseIf true, the body is interpreted as HTML.
attachmentsstring | List—A file path, several paths separated by commas or semicolons, or a list of paths.

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.

MessageCause 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 ErrorInvalidRecipientsAn address in to/cc/bcc is invalid. Check the text or the list items.
Graph error ErrorSendAsDenied / ErrorAccessDeniedThe account cannot send from that mailbox, or the connection lacks the Mail.Send permission.
Graph error about the request sizeThe attachments exceed the request limit. Send a link instead.
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 = pdf