我正在使用node-ews通过我的公司凭证通过MicroSoft交换发送电子邮件。
但是我不知道如何从本地磁盘存储中将.xlsx文件附加到电子邮件中。似乎没有简单的路径标签。
这就是我的东西
const ewsArgs = {
attributes: {
MessageDisposition: 'SendAndSaveCopy',
},
SavedItemFolderId: {
DistinguishedFolderId: {
attributes: {
Id: 'sentitems',
},
},
},
Items: {
Message: {
ItemClass: 'IPM.Note',
Subject: 'Subject',
Body: {
attributes: {
BodyType: 'Text',
},
$value: 'Bodytext',
},
ToRecipients: {
Mailbox: {
EmailAddress: 'email@email.ru',
},
},
IsRead: 'false',
Attachments: {
FileAttachment: [{
Name: 'filename.xlsx',
IsInline: false,
ContentType: 'text/xlsx',
ContentLocation: 'filename.xlsx',
}]
}
},
},
};
我做错了什么?
发布于 2020-10-03 17:25:49
检查你的contentLocation。您需要提供要附加的文件的正确路径。但你只是提供了文件名。
Content-Type: application/vnd.ms-excel
https://stackoverflow.com/questions/64182375
复制相似问题