Sending email
Factorial Code includes a built-in email helper so your processes can send email without configuring an SMTP server or managing credentials. The mail server and credentials live in the Factorial Code platform, never in your process.
Common uses:
- Notifying users when a process finishes (reports, exports, alerts).
- Sending error notifications from an error handler.
- Delivering links to files kept in Storage.
fcode.sendMail (JavaScript) / fcode.send_mail (Python) sends an email and returns the delivery result. Provide text, html, or both; to accepts a single address or a list.
const info = await fcode.sendMail({ subject: "Your report is ready", text: "Plain-text body", html: "<b>HTML body</b>",});
// info => { messageId, accepted, rejected }info = fcode.send_mail( subject="Your report is ready", text="Plain-text body", html="<b>HTML body</b>",)
# info => { "messageId", "accepted", "rejected" }