TypeScript mail sender with TLS handling, retries, and raw RFC822 output for iOS.
// Source: https://github.com/agenticmail/agenticmail | License: MIT | Copyright 2026 Ope Olatunji
// Provided via justclaw.it.com; keep this notice with the code.
import nodemailer from 'nodemailer';
import MailComposer from 'nodemailer/lib/mail-composer/index.js';
import type { Transporter } from 'nodemailer';
import type { SendMailOptions, SendResult } from './types.js';
export interface MailSenderOptions {
host: string;
port: number;
email: string;
password: string;
authUser?: string;
secure?: boolean;
tlsRejectUnauthorized?: boolean;
}
export interface SendResultWithRaw extends SendResult {
/** Raw RFC822 message bytes (for appending to Sent folder) */
raw: Buffer;
}
/** True for loopback hosts — the bundled local mail server lives here. */
export function isLoopb
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key