Free Support Forum - aspose.com

What is replacement for removed property: Aspose.Email.Mapi.MapiRecipientType.MAPI_ORIG

Hi,
Aspose.Email.Mapi.MapiRecipientType.MAPI_ORIG is removed, what can is replacing it ?

Thanks

@slavago,

I have observed the requirements. You shouldn’t use MapiRecipientType.MAPI_ORIG to create organizer as now this marked as obsolete. In new releases, we don’t need to set Attendees collection for MapiCalendar(f_MapiCalendarObj.Attendees = CalendarAttendees; ), now it will be correctly converted from Appointment.

So code from description may be changed like this:

        MailAddress organizer = new MailAddress("organizer@gmail.com", "Organaizer");
        string subject = "This is subject";
        string body = "This is body";
        DateTime startDate = DateTime.Now.AddHours(15);
        DateTime endDate = DateTime.Now.AddHours(16);
        MailAddressCollection mailAddressColl = new MailAddressCollection()
                                                             {
                                                                 new MailAddress(
                                                                     "attendee1@gmail.com", "Attendee1"),
                                                                 new MailAddress(
                                                                     "attendee2@gmail.com", "Attendee2"),
                                                                 new MailAddress(
                                                                     "attendee3@gmail.com", "Attendee3"),
                                                             };
        Appointment appointment = new Appointment(
                null,
                subject,
                body,
                startDate,
                endDate,
                organizer,
                mailAddressColl);

        MailMessage mail = new MailMessage();
        mail.AddAlternateView(appointment.RequestApointment());
        MapiMessage mapi = MapiMessage.FromMailMessage(mail);
        MapiCalendar mapiCalendar = (MapiCalendar)mapi.ToMapiMessageItem();
        using (PersonalStorage pst = PersonalStorage.Create(pst_file, FileFormatVersion.Unicode))
        {
            FolderInfo info = pst.CreatePredefinedFolder("Calendar", StandardIpmFolder.Appointments);
            info.AddMapiMessageItem(mapiCalendar);
        }