EWS — Pop up email to be sent

那年仲夏 提交于 2019-12-11 13:59:23

问题


I am able to create new emails using Exchange Web Service Managed API in a local desktop application. These messages contain quotes for products and services. What I want to do now is open the email before sending it so the user can edit and then send the email themselves. All users have Outlook 2013.


回答1:


If you need web-client access, you should be looking at the interop libraries and not EWS. EWS is meant to be run headless without client interaction (and therefore cannot open dialogs in Outlook).

An example of doing so in the interop library would look something like:

Outlook.Application outlook = new Outlook.Application();
Outlook.MailItem email = outlook.CreateItem(Outlook.OlItemType.olMailItem)
                         as Outlook.MailItem;
email.To = "client@rfq.com";
email.Subject = "Your Quote";
email.Body = "Here is your quote.";
email.Attachments.Add(@"C:\quotes\quote.pdf", Outlook.OlAttachmentType.olByValue,
                      Type.Missing, Type.Missing);
email.Display(false);


来源:https://stackoverflow.com/questions/29899527/ews-pop-up-email-to-be-sent

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!