Microsoft 365 Send

Microsoft 365 Send

Certified

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).

yaml
type: io.kestra.plugin.microsoft365.outlook.Send

Send a simple email

yaml
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

yaml
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

yaml
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

Email body

Body content

Azure client ID

Application (client) ID of the Graph app registration

Azure client secret

Client secret for the app registration; required for client-credentials flow

From address

Sender mailbox address used for Graph sendMail

Email subject

Subject line

Azure tenant ID

Entra tenant (directory) ID used for Graph auth

SubTypestring

To recipients

Email addresses for To

Email attachments

Attachments sourced from Kestra internal storage

SubTypestring

BCC recipients

Email addresses for BCC

Body type

Content type for body (Html or Text); defaults to Html

SubTypestring

CC recipients

Email addresses for CC

Reference (ref) of the pluginDefaults to apply to this task.

Defaulthttps://graph.microsoft.com/.default

Scopes

Space-separated Graph scopes; default uses .default application permissions

User principal name

Mailbox UPN/email to act on; defaults to app context when omitted

Default0

BCC recipient count

Number of recipients in the BCC field

Body type

Body content type (Html or Text)

Default0

CC recipient count

Number of recipients in the CC field

Email subject

Subject line of the sent email

Default0

To recipient count

Number of recipients in the To field