Skip to content
Local environment Preproduction — not production data

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.

Sending an email
const info = await fcode.sendMail({
to: "[email protected]", // string or array of strings
subject: "Your report is ready",
text: "Plain-text body",
html: "<b>HTML body</b>",
});
// info => { messageId, accepted, rejected }