How to set ItemProperties (Microsoft.Office.Interop.Outlook.AppointmentItem.ItemProperties) for the Meeting request sent through Aspose.Email

Hi,

As per the documentation / forum discussions, for setting an custom ItemProperties for Outlook items, we need to add Headers to the Aspose.Email.Mail.MailItem.

But after setting the headers and sending it through the SmtpClient, when we receive the meeting in Outlook, we are not able to get the item properties.

Please let us know where can we find this or how can we set the ItemProperties.

Hi Deivarayan,

Thanks for writing to Aspose.Email support team.

I have analyzed the requirement and need little clarification. In your post you mentioned that you need to add headers to the "Aspose.Email.Mail.MailItem". I could not find this MailItem in Aspose.Email.Mail hierarchy.

It seems that you are using MailMessage and appointment class to create an appointment and then send it through SmtpClient. If this is the case then how ItemProperties are used for setting the headers.

Second option is that you are using "Microsoft.Office.Interop.Outlook.Appointment" and
"Microsoft.Office.Interop.Outlook.MailItem" for setting the item properties but how SmtpClient is used to send the message in that case.

Could you please clarify the requirement and send us a working console application which can be used to re-produce the issue here. It will assist us to analyze the problem and provide solution as soon as possible.

Hi Kashif,

Thanks for the reply.

We wanted to know whether we can set some hidden/Custom properties into ASPOSE MailItem so that it can be retrieved from Outlook. We tried adding headers to the Aspose.Email.Mail.MailItem but couldn't retreive it in Outlook. Please let us know if there are any other possibilities.

Hi Deivarayan,

Thank you for clarification.

Aspose.Email does allow setting a custom header while sending an appointment, and these are visible in outlook if the appointment’s properties are checked in Outlook. However, it seems that you want to retrieve the sent appointment (through Aspose) using Outlook Interop. and facing some issue. Please confirm if I am right here?

Using the following code via Aspose API, I found this working when the sent appointment message’s properties are viewed in outlook.

Sample Code:

// create the meeting request
Appointment app = new Appointment("meeting request", DateTime.Now.AddMinutes(15), DateTime.Now.AddMinutes(30), "organizer@gmail.com", "attendee@aspose.com");
app.Summary = "meeting request summary";
app.Description = "description";

MailMessage msg = new MailMessage();
msg.From = "organizer@gmail.com";
msg.To = "attenedee@aspose.com";
msg.IsBodyHtml = true;
msg.HtmlBody = "HTML Heading Email Message detail";
msg.Subject = "meeting request";
msg.AddAlternateView(app.RequestApointment(0));
msg.Headers.Add("Secret-Header", "Test");

// send the appointment
SmtpClient client = GetSmtpClient();
client.Send(msg);