import type { Mail } from '../types.ts' import { transporter } from './transporter.ts' export function send(mail: Mail) { return transporter.sendMail({ from: mail.from.toString(), to: mail.to.map((contact) => contact.toString()), cc: mail.options.cc.map((cc) => cc.toString()), bcc: mail.options.cci.map((cci) => cci.toString()), subject: mail.subject, text: 'Text only', html: mail.body.toString(), attachments: mail.options.attachments.map((path) => ({ path })), }) }