
mailsend
mailsend
yaml
type: "io.kestra.plugin.email.mailsend"Examples
yaml
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.email.MailSend
from: hello@kestra.io
to: hello@kestra.io
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 }}"
yaml
id: send_email
namespace: company.team
inputs:
- id: attachments
type: ARRAY
itemType: JSON
tasks:
- id: send_email
type: io.kestra.plugin.email.MailSend
from: hello@kestra.io
to: hello@kestra.io
attachments: {{ inputs.attachments | toJson }}
yaml
id: send_email
namespace: company.team
inputs:
- id: embedded_image_uri
type: STRING
tasks:
- id: send_email
type: io.kestra.plugin.email.MailSend
from: hello@kestra.io
to: hello@kestra.io
embeddedImages:
- name: kestra.png
uri: "{{ inputs.embedded_image_uri }}"
contentType: image/png
yaml
id: export_audit_logs_csv
namespace: company.team
tasks:
- id: ship_audit_logs
type: "io.kestra.plugin.ee.core.log.AuditLogShipper"
lookbackPeriod: P1D
logExporters:
- id: file
type: io.kestra.plugin.ee.core.log.FileLogExporter
- id: convert_to_csv
type: "io.kestra.plugin.serdes.csv.IonToCsv"
from: "{{ outputs.ship_audit_logs.outputs.file.uris | first }}"
- id: send_email
type: io.kestra.plugin.email.MailSend
from: hello@kestra.io
to: hello@kestra.io
username: "{{ secret('EMAIL_USERNAME') }}"
password: "{{ secret('EMAIL_PASSWORD') }}"
host: mail.privateemail.com
port: 465 # or 587
subject: "Weekly Kestra Audit Logs CSV Export"
htmlTextContent: "Weekly Kestra Audit Logs CSV Export"
attachments:
- name: audit_logs.csv
uri: "{{ outputs.convert_to_csv.uri }}"
contentType: text/csv
triggers:
- id: schedule
type: io.kestra.plugin.core.trigger.Schedule
cron: 0 10 * * 5
yaml
id: send_email_internal
namespace: company.team
tasks:
- id: send_email
type: io.kestra.plugin.email.MailSend
from: noreply@company.local
to: admin@company.local
username: "{{ secret('INTERNAL_SMTP_USER') }}"
password: "{{ secret('INTERNAL_SMTP_PASSWORD') }}"
host: mail.company.local
port: 587
transportStrategy: SMTP_TLS
subject: "Internal notification"
htmlTextContent: "This email was sent from an internal mail server"
verifyServerIdentity: false
trustedHosts:
- mail.company.local
- smtp.company.local
- 192.168.1.100
Properties
attachmentsarraystring
ccstring
embeddedImagesarraystring
fromstring
hoststring
htmlTextContentstring
passwordstring
plainTextContentstring
portintegerstring
sessionTimeoutintegerstring
Default
10000subjectstring
tostring
transportStrategystring
Default
SMTPSPossible Values
SMTPSMTPSSMTP_TLSSMTP_OAUTH2trustedHostsarray
SubTypestring
usernamestring
verifyServerIdentitybooleanstring
Default
true