我想从附加从excel4node库编写的.xlsx的nodemailer发送邮件。我不知道怎么做,但我可以单独做这两件事。
我尝试写入文件并将其存储为临时文件,然后再次调出该文件,但firebase弹出错误Error: EROFS: read-only file system, open
我真的不知道该怎么做,请帮帮忙。提前感谢。
发布于 2019-07-28 10:29:26
我拿到了!使用来自excel4node的写缓冲区,然后将它们发送到附件的内容
发布于 2021-11-07 05:43:49
const xl = require('excel4node');
async sendMail(data) {
var wb = new xl.Workbook();
var ws = wb.addWorksheet('SHEET_NAME');
ws.cell(1, 1).string('ALL YOUR EXCEL SHEET FILE CONTENT');
let buffer_xlsx = await wb.writeToBuffer();
// in the option header of nodeMailer
header: {
from: 'abc@example.com',
to: 'xyz@example.com',
subject: 'Excel File',
attachments = [
{
filename: 'report_' + filename + '.xlsx',
content: buffer_xlsx,
}]
}https://stackoverflow.com/questions/57235699
复制相似问题