Getting null in e.MailItem.Message.CalendarPart in

2019-09-13 06:15发布

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条回答
男人必须洒脱
2楼-- · 2019-09-13 06:42

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.

查看更多
登录 后发表回答