Email Service
Post in
四 05 九月 2024
生成邮件模板并发送邮件
async function sendEmail(
email: string,
filename: string,
content: Buffer,
subject = "材料下载"
) {
const htmlTemplate = await generateHtmlForFileDownload();
const …async function sendEmail(
email: string,
filename: string,
content: Buffer,
subject = "材料下载"
) {
const htmlTemplate = await generateHtmlForFileDownload();
const …解析 Content-Type: multipart/form-data
const form = new formidable({ multiples: true });
form.parse(req, async (err, fields, files) => {
if (err) {
res.status(400).json({ error: `Invalid request: ${err}` });
return …import * as express from 'express';
# .babel es6 => es5 X
# default => import
import express from 'express';
const Com = () => {
return (<div></div>)
}
export default Com;
正常用Js
import Com from …Page 1 / 1