Send an email via Microsoft Graph API
Send an email message through Outlook using Microsoft Graph API. Supports HTML and plain text content, multiple recipients, attachments, and various email options.
type: "io.kestra.plugin.microsoft365.outlook.Send"Examples
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: "[email protected]"
to:
- "[email protected]"
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: "[email protected]"
to:
- "[email protected]"
cc:
- "[email protected]"
- "[email protected]"
bcc:
- "[email protected]"
subject: "Important Notification"
body: "This is a plain text email sent from Kestra workflow."
bodyType: "Text"
Properties
body *Requiredstring
Email body
Body content of the email
clientId *Requiredstring
Client ID
Azure application (client) ID
clientSecret *Requiredstring
Client Secret
Azure client secret
from *Requiredstring
From address
Email address to send from (optional, uses authenticated user if not specified)
subject *Requiredstring
Email subject
Subject line of the email
tenantId *Requiredstring
Tenant ID
Azure tenant ID (directory ID)
to *Requiredarray
To recipients
List of email addresses to send the email to
bcc array
BCC recipients
List of email addresses to blind carbon copy
bodyType string
Body type
Content type of the email body (Html or Text)
cc array
CC recipients
List of email addresses to carbon copy
scopes string
https://graph.microsoft.com/.defaultScopes
Scopes for Microsoft Graph
userPrincipalName string
User Principal Name
User email to act on behalf of (optional)
Outputs
bccCount integer
0BCC recipient count
Number of recipients in the 'bcc' field
bodyType string
Body type
Content type of the email body (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