We are trying to migrate all of the .msg files that were archived outside of Exchange on prem to outlook.office365
for the upload portion I have been using the Microsoft.Exchange.WebServices and passing the mapimessage saving as an email message and uploading to which folder matches the MessageClass
We haven’t had a problem with the IPM.Note going to the Inbox, however when an IPM,Appointment is uploaded to the Calendar it does not show on the calendar.
from all of the samples I find on the Aspose site none seem to handle this.
.msg of MessageClass IPM,Appointment uploading with Exchange EWS Client to the Calendar
Would it be possible to provide sample code for this.
What code sample are you trying at your end? We have used the following sample code that saves a MapiCalendar in ICS format and then creates appointment on Office 365 and it works. Please try it at your end and if the issue still persists, please share your sample code with us for further investigation at our end.
Sample Code
IEWSClient client = EWSClient.GetClient...; //use your office 365 account
MapiMessage msg = MapiMessage.FromFile("Calendar.msg");
MapiCalendar cal = (MapiCalendar)msg.ToMapiMessageItem();
MemoryStream ms = new MemoryStream();
cal.Save(ms);
ms.Position = 0;
Appointment app = Appointment.Load(ms);
client.CreateAppointment(app);
PS: Please use the latest version of the API at your end i.e. Aspose.Email for .NET 17.6.
Please try the following code sample that works fine at my end using the latest version of the API and let us know your feedback if you come across some problem.
Thanks for your quick response that did solve the issue we were having loading the Tasks.
Could I also ask about the previous code you provided for uploading the Calendar entries.
Like I mentioned previously we are uploading many emails for each user and with we are the code provided we are also getting a notification going to the inbox of the user when placing the appointment on the calendar.
Is there a way we can suppress these notifications as they are filling up the users inbox as these calendar entries are older archived messages that we are just wanting to transfer to their outlook 365 account.
We have tested this at our end and are not able to observe any such notifications to the inbox when placing the appointment on the calendar. Could you please use the following test account to execute above code and help us reproduce the scenario you have mentioned above? In case the behavior is reproduced, please also share a sample input file with us for further investigation at our end.
I think my description should have been better. What I should have said is the recipients that were on the calendar item which was added to our Test account mailbox received a notification in their inbox from the Test account mailbox user about the calendar item.
The Test account didn’t receive anything in its inbox it was the original recipients that were on the appointment that received notifications from the Test account.
The following code sample seems to serve your purpose. Please use ConvertAsTnef = true during conversion from MapiMessage to MailMessage. In this case, the calendar item is appended to the folder and no notifications are sent out to the attendees.
I am hoping you can help with the code examples for java.
The samples provided did work great for .NET however I need to try the same scenario in java.
like I mentioned before we have millions of emails to transfer to outlook 365 and I needed to compare any speed difference.
I was hoping I would have the same results with this:
The IPM.Note does show in the Inbox
However he IPM.Task and IPM.Appointment are not showing
Could you assist with the same scenario in java?
Thanks for your help.
if (mapiMess.getMessageClass().equals("IPM.Note"))
{
MailConversionOptions mco = new MailConversionOptions();
MailMessage mailMessage = mapiMess.toMailMessage(mco);
client.appendMessage(client.getMailboxInfo().getInboxUri(),mailMessage);
}
else if (mapiMess.getMessageClass().equals("IPM.Task"))
{
MailMessage eml = mapiMess.toMailMessage(new MailConversionOptions() { @Override
public void setConvertAsTnef(boolean b)
{
super.setConvertAsTnef(true);
} });
client.appendMessage(client.getMailboxInfo().getTasksUri(), eml);
}
else if (mapiMess.getMessageClass().equals("IPM.Appointment"))
{
MailMessage eml = mapiMess.toMailMessage(new MailConversionOptions() { @Override
public void setConvertAsTnef(boolean b)
{
super.setConvertAsTnef(true);
} });
client.appendMessage(client.getMailboxInfo().getCalendarUri(),eml);
}