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