Outlook加载项转发所选电子邮件
我刚开始创建Office加载项,但遇到了一些问题。我正在尝试创建一个外接程序,用于转发当前选定电子邮件的内容。作为附件,最好发送到不同的电子邮件地址 我正在尝试使用Web加载项创建此文件。我已经浏览了很多关于here和Microsoft文档的其他帖子,发现其中一篇是使用EWS发送电子邮件;但是,我不知道如何将内容作为附件发送Outlook加载项转发所选电子邮件,outlook,exchangewebservices,outlook-web-addins,outlook-restapi,Outlook,Exchangewebservices,Outlook Web Addins,Outlook Restapi,我刚开始创建Office加载项,但遇到了一些问题。我正在尝试创建一个外接程序,用于转发当前选定电子邮件的内容。作为附件,最好发送到不同的电子邮件地址 我正在尝试使用Web加载项创建此文件。我已经浏览了很多关于here和Microsoft文档的其他帖子,发现其中一篇是使用EWS发送电子邮件;但是,我不知道如何将内容作为附件发送 function sendEmail() { var item = Office.context.mailbox.item; var request = '
function sendEmail() {
var item = Office.context.mailbox.item;
var request = '<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">' +
' <soap:Header><t:RequestServerVersion Version="Exchange2010" /></soap:Header>' +
' <soap:Body>' +
' <m:CreateItem MessageDisposition="SendAndSaveCopy">' +
' <m:SavedItemFolderId><t:DistinguishedFolderId Id="sentitems" /></m:SavedItemFolderId>' +
' <m:Items>' +
' <t:Message>' +
' <t:Subject>' + item.subject + '</t:Subject>' +
' <t:Body BodyType="HTML">Hello World!</t:Body>' +
' <t:ToRecipients>' +
' <t:Mailbox><t:EmailAddress>' + Office.context.mailbox.userProfile.emailAddress + '</t:EmailAddress></t:Mailbox>' +
' </t:ToRecipients>' +
' </t:Message>' +
' </m:Items>' +
' </m:CreateItem>' +
' </soap:Body>' +
'</soap:Envelope>';
Office.context.mailbox.makeEwsRequestAsync(request, function (asyncResult) {
if (asyncResult.status == "failed") {
console.log("Action failed with error: " + asyncResult.error.message);
}
else {
console.log("Message sent!");
}
});
}
函数sendmail(){
var item=Office.context.mailbox.item;
var请求=“”+
' ' +
' ' +
' ' +
' ' +
' ' +
' ' +
''+项目.主题+''+
“你好,世界!”+
' ' +
''+Office.context.mailbox.userProfile.emailAddress+''+
' ' +
' ' +
' ' +
' ' +
' ' +
'';
Office.context.mailbox.makeEwsRequestAsync(请求,函数(asyncResult)){
如果(asyncResult.status==“失败”){
log(“操作失败,错误为:+asyncResult.error.message”);
}
否则{
日志(“消息已发送!”);
}
});
}
Office.js中是否实现了发送电子邮件的功能?有人有什么建议吗?我尝试使用VSTO,但经常出现随机崩溃和加载项未显示的问题
谢谢你可以试试这个。。namefalseMimeContent@BrianClink谢谢你的回复!你能给我举个例子吗?我想弄明白,但运气不好。谢谢我认为您需要先在草稿中创建项目,然后使用MIME内容添加“消息”附件。对不起,我不能提供样品。谢谢你的帮助,我会看看我还能从中找到什么。谢谢目前,通过OfficeJS API发送电子邮件的功能不是该产品的一部分。我们在用户语音页面上跟踪Outlook加载项功能请求。请在那里添加您的请求。在我们进行规划过程时,会考虑用户语音的功能请求。或者,你可以试试@Brian的建议。