Back
Version 1
8/26/2024
import { email } from "https://esm.town/v/std/email?v=11";
export async function forwarder(e: {
from: string;
to: string[];
subject: string;
text: string;
html: string;
attachments?: File[];
}) {
let attachments = [];
for (const f of e.attachments) {
attachments: e.attachments.map((f) => ({
name: f.name,
content: Buffer.from(await f.arrayBuffer()).toString("base64"),
}));
}
// content: string;
// filename: string;
// type?: string;
// disposition?: string;
// contentId?: string;
return email({ html: e.html, subject: e.from + ": " + e.subject, attachments });
}
Updated: August 27, 2024