MailSend
Send an automated email from a workflow.
type: "io.kestra.plugin.notifications.mail.MailSend"
Examples
Send an email on a failed flow execution.
id: unreliable_flow
namespace: company.team
tasks:
- id: fail
type: io.kestra.plugin.scripts.shell.Commands
runner: PROCESS
commands:
- exit 1
errors:
- id: send_email
type: io.kestra.plugin.notifications.mail.MailSend
from: [email protected]
to: [email protected]
username: "{{ secret('EMAIL_USERNAME') }}"
password: "{{ secret('EMAIL_PASSWORD') }}"
host: mail.privateemail.com
port: 465 # or 587
subject: "Kestra workflow failed for the flow {{flow.id}} in the namespace {{flow.namespace}}"
htmlTextContent: "Failure alert for flow {{ flow.namespace }}.{{ flow.id }} with ID {{ execution.id }}"
Send an email with attachments.
id: send_email
namespace: company.team
inputs:
- id: attachments
type: ARRAY
itemType: JSON
tasks:
- id: send_email
type: io.kestra.plugin.notifications.mail.MailSend
from: [email protected]
to: [email protected]
attachments: {{ inputs.attachments | toJson }}
Send an email with an embedded image.
id: send_email
namespace: company.team
inputs:
- id: embedded_image_uri
type: STRING
tasks:
- id: send_email
type: io.kestra.plugin.notifications.mail.MailSend
from: [email protected]
to: [email protected]
embeddedImages:
- name: kestra.png
uri: "{{ inputs.embedded_image_uri }}"
contentType: image/png
Properties
attachments arraystring
Adds an attachment to the email message
The attachment will be shown in the email client as separate files available for download or display.Inline if the client supports it (for example, most browsers display PDF's in a popup window).
cc string
One or more 'Cc' (carbon copy) optional recipient email address. Use semicolon as delimiter to provide several addresses.
Note that each email address must be compliant with the RFC2822 format.
embeddedImages arraystring
Adds image data to this email that can be referred to from the email HTML body.
The provided images are assumed to be of MIME type png, jpg, or whatever the email client supports as valid image that can be embedded in HTML content.
from string
The address of the sender of this email
host string
The email server host
htmlTextContent string
The optional email message body in HTML text
Both text and HTML can be provided; either will be offered to the email client as alternative content.Email clients that support it, will favor HTML over plain text and ignore the text body completely.
password string
The email server password
plainTextContent string
The optional email message body in plain text
Both text and HTML can be provided; either will be offered to the email client as alternative content.Email clients that support it, will favor HTML over plain text and ignore the text body completely.
port integerstring
The email server port
sessionTimeout integerstring
10000
Integer value in milliseconds. Default is 10000 milliseconds, i.e. 10 seconds
It controls the maximum timeout value when sending emails.
subject string
The optional subject of this email
to string
Email address(es) of the recipient(s). Use semicolon as delimiter to provide several email addresses.
Note that each email address must be compliant with the RFC2822 format.
transportStrategy string
SMTPS
SMTP
SMTPS
SMTP_TLS
SMTP_OAUTH2
The optional transport strategy
Will default to SMTPS if left empty
username string
The email server username