Getting null in e.MailItem.Message.CalendarPart in exchange transport agent

混江龙づ霸主 提交于 2019-12-25 04:24:36

问题


I am developing a custom transport agent for Exchange 2013. I am getting null in e.MailItem.Message.CalendarPart though I am sending a meeting request.

   if (e.MailItem.Message.CalendarPart != null)
        {
            LocationProcessorStrategy.AddLocationInBody(e.MailItem.Message);
        }
        else
        {
            e.MailItem.Message.Subject += " [There is no calendar part - added by agent.]";
        }

e.MailItem.Message.MapiMessageClass is giving me the value "IPM.Schedule.Meeting.Request" but CalendarPart is null.


回答1:


That generally means that at the Messaging stage you trying to intercept the message there is no ICal Body part to parse. iCal is usually create post categorisation depending on the recipient type https://technet.microsoft.com/en-us/library/bb232174(v=exchg.150).aspx . So either push your Agent to run after categorisation has occurred or use the TNEFReader/TNEFWriter to parse the TNEFStream for the message. Note you may need two solution if you want process bother internal and external Calendar Invites because of the formats used.



来源:https://stackoverflow.com/questions/38367946/getting-null-in-e-mailitem-message-calendarpart-in-exchange-transport-agent

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