mirror of
https://github.com/eleith/emailjs.git
synced 2026-11-13 22:34:00 +00:00
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.
22 lines
544 B
JavaScript
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)
|
|
}
|