0
votes

I am trying to calculate the time taken to send email message and time taken to receive email message. i am using EWS in my program , I set streaming notification to receive call back when a new mail reaches reciptent mailbox .

once received notification i bind the Itemevent with ews service , i checked the item properties DateTimeCreated, DateTimeSent, DateTimeReceived.All these properties are of DateTime object.

I checked DateTimeSent milisecond property is always 0, whereas DateTimeCreated, DateTimeReceived has millisecond value.

I couldnot figure out why DateTimeSent millisecond is always 0 everytime. if i want to claulate time taken from send to receive what should i do.

DateTimeReceived - Datetimesent is the actual time taken to send the message?

Regards, kishore

1

1 Answers

0
votes

You can think about the ItemEvent as a union class which stores information to different events (there can be different events and the corresponding fields will be filled according to the event)

I suggest you to bind the item with the explicit item type, For example: EmailMessage and not the ItemEvent itself. You can look at this thread:

Identify item type when handling event in Exchange Web Services (EWS)