我尝试了以下多部分内容类型。稍后我将使用SheetJS附加一个excel文件。但是现在我无法附加有效的空白excel文件。任何帮助将不胜感激。
let text =
'To: User <user@domain.demo>\n' +
'Subject: TW Order\n' +
'X-Unsent: 1\n' +
'Content-Type: multipart/mixed; boundary=--boundary_text_string\n\n' +
'----boundary_text_string\n' +
//'Content-Type: application/application/vnd.openxmlformats-officedocument.spreadsheetml.sheet; name=demo.xlsx\n' +
'Content-Type: application/octet-stream; name=demo.xlsx\n' +
'Content-Disposition: attachment;\n\n' +
'----boundary_text_string--';
答案 0 :(得分:0)
因此,为了将xlsx文件附加到eml,我们必须执行以下操作
let text =
'To: User <user@domain.demo>\n' +
'Subject: TW Order\n' +
'X-Unsent: 1\n' +
'Content-Type: multipart/mixed; boundary=--boundary_text_string\n\n' +
'----boundary_text_string\n' +
'Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;\n' +
'Content-Transfer-Encoding: base64\n'
'Content-Disposition: inline; filename=a.xlsx\n\n' +
'base64 data goes here\n\n'
'----boundary_text_string--';