Free Support Forum - aspose.cloud

Uploading .msg MessageClass IPM.Appointment to Exchange in the cloud


#1

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.

Thanks


#2

Hi Don,

Thank you for posting your inquiry.

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.


#3

Thank you very much

using your sample code the MessageClass IPM.Appointment did add to the calendar and they do show on the calendar now.


#4

Hi Don,

You are welcome and please feel free to write to us in case of any further inquiry related to the API.


#5

There is one more thing I am having trouble with and can not find a sample.

I am having the same problem adding the IPM.Task same scenario

.msg file MessageClass IPM.Task need to add to office 365 through Exchange EWS Client

Maybe you could help with this one also, thanks again


#6

@dewebb,

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.

Sample Code

IEWSClient client = GetOffice365Account("UserOne@AsposeJun2017.onmicrosoft.com");

MapiMessage msg = MapiMessage.FromFile("OutlookTask.msg");

MailMessage eml = msg.ToMailMessage(new MailConversionOptions() { ConvertAsTnef = true});

client.AppendMessage(client.MailboxInfo.TasksUri, eml);

Thanks,
Kashif


#7

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.


#8

@dewebb,

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.

Test Office365 Account

Username: UserOne@AsposeJun2017.onmicrosoft.com
Password: Aspose1234


#9

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.


#10

@dewebb,

We are further investigating this issue at our end and will soon share our findings with you here. Your patience until then is highly appreciated.


#11

@dewebb,

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.

Sample Code

MapiMessage msg = MapiMessage.FromFile("AppToOffice365\\Appending Meetings to Cloud.msg");

MailMessage eml = msg.ToMailMessage(new MailConversionOptions() { ConvertAsTnef = true });

IEWSClient client = GetOffice365Account("UserOne@AsposeJun2017.onmicrosoft.com");

client.AppendMessage(client.MailboxInfo.CalendarUri, eml);

client.Dispose();

Please try it at your end and let us know your feedback.


#12

Thanks for you quick reply , This code did give the desired results.
We really appreciate your assistance.

Notifications are no longer being sent to the other recipients inboxes when adding calendar items using the new code sample.


#13

@dewebb,

You are welcome and please feel free to write to us for your queries related to the API.


#14

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);
        }

#15

Thanks I should have looked at it more before I jumped to your aid.

            MailConversionOptions mco = new MailConversionOptions();
            mco.setConvertAsTnef(true);
            MailMessage eml = mapiMess.toMailMessage( mco);

            client.appendMessage(client.getMailboxInfo().getCalendarUri(),eml);

They do show if I change the code to this.

thanks,


#16

@dewebb,

We hope you have got it working at your end with the above sample code. If you still have any inquiry, please feel free to write to us.