We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Unable to know how to read some properties while extracting metadata from a MapiMessage

Dear Aspose Team,


I want to know how we can extract information for the following properties based on message class.

1). If the Message class is IPM.Schedule.Meeting I don’t know how to read the following properties information.

StartTime, EndTime, Location, ResponseStatus.

2). If the Message class is IPM.Appointment, I want to know how to extract the information for the following properties.

StartTime, EndTime, Location

3). If the Message class is IPM.Task, I want to know how to extract the “Task owner” property.

4). How can we know a message’s last modification time.

Thanks & Regards,
N.Murali Krishna.

Hi Murali,


Thank you for writing to Aspose support team.

Please use following code to extract the required information and let us know your feedback.




static void Email_639083()

{

String path = url + “Email_639083\”;

string[] filePaths = Directory.GetFiles(path, ".msg");

foreach (String file in filePaths)

{

MapiMessage mapi = MapiMessage.FromFile(file);

Console.WriteLine("Subject = " + mapi.Subject);

if (mapi.Properties.Contains(MapiPropertyTag.PR_LAST_MODIFICATION_TIME))

{

MapiProperty lastModTime = mapi.Properties[MapiPropertyTag.PR_LAST_MODIFICATION_TIME];

Console.WriteLine("Modification Time = " + lastModTime.GetDateTime());

}

MapiProperty MsgClass = mapi.Properties[MapiPropertyTag.PR_MESSAGE_CLASS_W];

String data = MsgClass.GetString();

/

* IPM.Schedule.Meeting.Canceled Meeting cancellations
IPM.Schedule.Meeting.Request Meeting requests
IPM.Schedule.Meeting.Resp.Neg Responses to decline meeting requests
IPM.Schedule.Meeting.Resp.Pos Responses to accept meeting requests
IPM.Schedule.Meeting.Resp.Tent Responses to tentatively accept meeting requests
*/

if (mapi.MessageClass.Contains(“IPM.Schedule.Meeting”))

{

MapiCalendar cal = (MapiCalendar)mapi.ToMapiMessageItem();

Console.WriteLine("Start Time = " + cal.StartDate);

Console.WriteLine("End Time = " + cal.EndDate);

Console.WriteLine("Location = " + cal.Location);

Console.WriteLine("Response Status = " + cal.MessageClass);

}

else if (mapi.MessageClass == “IPM.Appointment”)

{

MapiCalendar cal = (MapiCalendar)mapi.ToMapiMessageItem();

Console.WriteLine("Start Time = " + cal.StartDate);

Console.WriteLine("End Time = " + cal.EndDate);

Console.WriteLine(“Location = " + cal.Location);

}

else if (mapi.MessageClass == “IPM.Task”)

{

MapiTask task = (MapiTask)mapi.ToMapiMessageItem();

Console.WriteLine(“Task Owner = " + task.Users.Owner);

}

Console.WriteLine(”____________________________________________”);


}

}

Hi Muhammad Waqas,


Finally last but not the least, if a message class is IPM.Schedule.Meeting is there any property to know that the user response status where the status is Organized (or) Tentative (or) Accepted (or) Declined (or) NotResponded (or) None.

I have tested all the properties as mentioned by you above all of them were working fine. Thank you so much for the help.
Thanks & Regards,
N.Murali Krishna.

Hi Murali,


Thank you for sharing feedback about the suggested code sample.

For your requirement of knowing the status, there is no such method available at present. We already have an enhancement ticket logged as EMAILNET-34830 in our issue tracking system for this feature. Once it is available, we shall notify you here for using it.

Please feel free to write to us if you have further query related to Aspose.Email API.

The issues you have found earlier (filed as EMAILNET-34878) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.