Free Support Forum - aspose.com

Email Message Vs Calendar Invite

Hello,

When reating messages from Inbox, is there a way to differentiate between Email Messages and Calendar Invite?

When I read what is the Inbox, I can't seem to tell the difference. Is there a property on the MailMessage that indicate the difference?

Thanks,

Jm

Hi Jm,

Thank you for inquiry.

I am sorry, such property is not available in MailMessage. I have logged a new feature request (ID: 29774) for this. We will inform you when this feature becomes available.

Hi Jm,

Please use the below method that reads the message headers to determine if it is an appointment.

private bool IsAppointment(MailMessage msg)
{
// return true if it is an appointment
if (msg.Headers[“content-type”].Contains(“text/calendar”) == true)
return true;

// check each alternate view in case of multipart message
if (msg.Headers[“content-type”].Contains(“multipart/alternative”) == true)
{
// check in alternate views
foreach (AlternateView view in msg.AlternateViews)
{
if (view.ContentType.ToString().Contains(“text/calendar”) == true)
return true;
}
}

return false;
}

The issues you have found earlier (filed as ) have been fixed in this update. This message was posted using BugNotificationTool from Downloads module by MuzammilKhan