来自EWS托管API的Internet消息ID发送电子邮件c# [英] Internet Message ID FROM EWS Managed API Send Email c#

查看:101
本文介绍了来自EWS托管API的Internet消息ID发送电子邮件c#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试发现使用EWS托管API发送电子邮件后是否可以确定Internet消息ID.我了解您可以进入该页面并从已发送"框中获取结果,但是发送这些电子邮件的服务器正在一次从不同的服务发送多封电子邮件.

I am trying to discover if there is a way to determine the internet message ID after sending an email using the EWS Managed API. I understand you can go in there and get the results from the sent box, but the server that is sending these emails is sending multiple emails at a time from different services.

推荐答案

不,基本上是因为EWS异步发送消息,因此ID不可用,请参见

No you can't, basically because EWS sends message Asynchronously the Id isn't available see https://social.msdn.microsoft.com/Forums/azure/en-US/dd034b8c-ffa1-4ae0-9025-45fcf520c9e5/updateitem-does-not-return-itemid?forum=exchangesvrdevelopment

作为解决方法,您可能需要在发送消息之前考虑在消息上设置Internet messageId.只要有效且唯一,它就可以正常工作,例如

As a work around you might want to consider setting the Internet messageId on the Message before you send it. As long as it valid and unique it should work okay eg

        ExtendedPropertyDefinition PidTagInternetMessageId = new ExtendedPropertyDefinition(4149, MapiPropertyType.String);
        EmailMessage ema = new EmailMessage(service);
        ema.Subject ="test from ews";
        ema.Body = new MessageBody("test<br>Rgds<>");
        ema.ToRecipients.Add("gscales@domain.com");
        ema.SetExtendedProperty(PidTagInternetMessageId,("<" +Guid.NewGuid().ToString() + "@domain.com>"));
        ema.SendAndSaveCopy();

如果在发送之前先将消息另存为草稿,服务器将分配MessageId属性,该属性随后应能够使用Load读取.

Also if you save the message first as a draft before sending it the server will assign the MessageId property which which should then be able to read back using Load.

欢呼 格伦

这篇关于来自EWS托管API的Internet消息ID发送电子邮件c#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆