
Microsoft 365 Send
CertifiedSend email via Microsoft Graph
Microsoft 365 Send
Send email via Microsoft Graph
Sends an email with optional CC/BCC, HTML or text body, and attachments from Kestra storage. Requires Microsoft Graph permission Mail.Send (application).
type: io.kestra.plugin.microsoft365.outlook.SendExamples
Send a simple email
id: send_outlook_email
namespace: company.team
tasks:
- id: send_email
type: io.kestra.plugin.microsoft365.outlook.Send
tenantId: "{{ secret('AZURE_TENANT_ID') }}"
clientId: "{{ secret('AZURE_CLIENT_ID') }}"
clientSecret: "{{ secret('AZURE_CLIENT_SECRET') }}"
from: "sender@example.com"
to:
- "recipient@example.com"
subject: "Hello from Kestra"
body: "<h1>Hello!</h1><p>This email was sent from a Kestra workflow.</p>"
bodyType: "Html"
Send email with CC, BCC, and plain text
id: send_detailed_email
namespace: company.team
tasks:
- id: send_email
type: io.kestra.plugin.microsoft365.outlook.Send
tenantId: "{{ secret('AZURE_TENANT_ID') }}"
clientId: "{{ secret('AZURE_CLIENT_ID') }}"
clientSecret: "{{ secret('AZURE_CLIENT_SECRET') }}"
from: "sender@example.com"
to:
- "primary@example.com"
cc:
- "cc1@example.com"
- "cc2@example.com"
bcc:
- "bcc@example.com"
subject: "Important Notification"
body: "This is a plain text email sent from Kestra workflow."
bodyType: "Text"
Send email with an attachment
id: send_email_with_attachment
namespace: company.team
inputs:
- id: report_uri
type: STRING
tasks:
- id: send_email
type: io.kestra.plugin.microsoft365.outlook.Send
tenantId: "{{ secret('AZURE_TENANT_ID') }}"
clientId: "{{ secret('AZURE_CLIENT_ID') }}"
clientSecret: "{{ secret('AZURE_CLIENT_SECRET') }}"
from: "sender@example.com"
to:
- "recipient@example.com"
subject: "Weekly report"
body: "See attached report."
attachments:
- name: "report.csv"
uri: "{{ inputs.report_uri }}"
contentType: "text/csv"
Properties
body *Requiredstring
Email body
Body content
clientId *Requiredstring
Azure client ID
Application (client) ID of the Graph app registration
clientSecret *Requiredstring
Azure client secret
Client secret for the app registration; required for client-credentials flow
from *Requiredstring
From address
Sender mailbox address used for Graph sendMail
subject *Requiredstring
Email subject
Subject line
tenantId *Requiredstring
Azure tenant ID
Entra tenant (directory) ID used for Graph auth
to *Requiredarray
To recipients
Email addresses for To
attachments arraystring
Email attachments
Attachments sourced from Kestra internal storage
bcc array
BCC recipients
Email addresses for BCC
bodyType string
Body type
Content type for body (Html or Text); defaults to Html
cc array
CC recipients
Email addresses for CC
pluginDefaultsRef Non-dynamicstring
Reference (ref) of the pluginDefaults to apply to this task.
scopes string
https://graph.microsoft.com/.defaultScopes
Space-separated Graph scopes; default uses .default application permissions
userPrincipalName string
User principal name
Mailbox UPN/email to act on; defaults to app context when omitted
Outputs
bccCount integer
0BCC recipient count
Number of recipients in the BCC field
bodyType string
Body type
Body content type (Html or Text)
ccCount integer
0CC recipient count
Number of recipients in the CC field
subject string
Email subject
Subject line of the sent email
toCount integer
0To recipient count
Number of recipients in the To field