notification-providers/smtp.js

uptime-kuma · server/notification-providers/smtp.js · javascript · MIT
email

SMTP notification provider handling TLS, DKIM, templated emails.

// Source: https://github.com/louislam/uptime-kuma | License: MIT | Copyright 2021 Louis Lam
// Provided via justclaw.it.com; keep this notice with the code.
const nodemailer = require("nodemailer");
const NotificationProvider = require("./notification-provider");
const { log } = require("../../src/util");

class SMTP extends NotificationProvider {
    name = "smtp";

    /**
     * @inheritdoc
     */
    async send(notification, msg, monitorJSON = null, heartbeatJSON = null) {
        const okMsg = "Sent Successfully.";

        const config = {
            host: notification.smtpHost,
            port: notification.smtpPort,
            secure: notification.smtpSecure,
            headers: {},
        };

        // Handle TLS/STARTTLS options
        if (!notification.smtpSecure && not

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key