Files
emailjs/scripts/mailpit-client.js
eleith 1544f0300f style: normalize formatting before adopting Oxfmt
Apply the existing tabs, quotes, semicolon, and line-width conventions across source, tests, examples, documentation, and configuration. Include Oxfmt's parentheses around a conditional type without changing behavior.
2026-10-26 14:49:11 -07:00

22 lines
544 B
JavaScript

// scripts/mailpit-client.js
// Common client setup for connecting to Mailpit
import { SMTPClient } from '../dist/index.js'
export function getMailpitClient(overrides = {}) {
const defaultOptions = {
host: 'localhost',
port: 1025, // Mailpit SMTP Port
user: 'user',
password: 'password123',
// Mailpit uses a self-signed cert, so rejectUnauthorized: false is needed for TLS/STARTTLS
tls: {
rejectUnauthorized: false,
},
}
const clientOptions = { ...defaultOptions, ...overrides }
return new SMTPClient(clientOptions)
}