Modify Occurrences from Recurrence Pattern with Aspose.Email for .NET 17.5.0

We are pleased to announce the release of Aspose.Email for .NET 17.5.0. This month’s release includes a new feature to modify or delete an occurrence from a recurrence pattern. It also includes several enhancements related to different API functionality. All these changes have been documented in the release notes section of API documentation for user’s reference.

Features and Enhancements

Modify or Delete Occurrence from Recurrence Pattern: Aspose.Email API allows working with recurrence patterns for Outlook Calendar items. This month’s release further enriches this feature of the API by allowing to modify or delete a specific occurrence from a recurrence pattern. This is achieved by adding an exception to the occurrences of a recurrence pattern as shown in the following code sample.

DateTime startDate = DateTime.Now.Date.AddHours(12);

MapiCalendarEventRecurrence recurrence = new MapiCalendarEventRecurrence();
MapiCalendarRecurrencePattern pattern = recurrence.RecurrencePattern = new MapiCalendarDailyRecurrencePattern();
pattern.PatternType = MapiCalendarRecurrencePatternType.Day;
pattern.Period = 1;
pattern.EndType = MapiCalendarRecurrenceEndType.NeverEnd;

DateTime exceptionDate = startDate.AddDays(1);

// adding one exception
pattern.Exceptions.Add(new MapiCalendarExceptionInfo
    Location = "London",
    Subject = "Subj",
    OriginalStartDate = exceptionDate,
    StartDateTime = exceptionDate,
    EndDateTime = exceptionDate.AddHours(5)
// every modified instance also has to have an entry in the DeletedInstanceDates field with the original instance date.

// adding one deleted instance

MapiRecipientCollection recColl = new MapiRecipientCollection();
recColl.Add("", "receiver", MapiRecipientType.MAPI_TO);
MapiCalendar newCal = new MapiCalendar(
    "This is Location",
    "This is Summary",
    "This is recurrence test",
newCal.Recurrence = recurrence;

using (MemoryStream memory = new MemoryStream())
    PersonalStorage pst = PersonalStorage.Create(memory, FileFormatVersion.Unicode);
    FolderInfo calendarFolder = pst.CreatePredefinedFolder("Calendar", StandardIpmFolder.Appointments);

Filtering Messages by Message Size using EWS: Want to filter messages from Exchange server based on message size? We have implemented this feature by incorporating the MessageSize search parameter in ExchangeQueryBuilder. Messages can be filtered from Exchange server based on message size as illustrated in the code sample below.

ExchangeQueryBuilder builder1 = new ExchangeQueryBuilder();

Forwarding Messages without loading using MailMessage: We have another good news for people whose environments consist of low resources such as system memory. Such situation can give rise to problems sometimes including out of memory exceptions while loading large message files. This month’s version now provides the capability to load the file in file stream and send it using the API’s SMTP client without using MailMessage.

Getting Folder Type Information using EWS: This month’s release also provides the capability to get folder type information for the folders retrieved from Exchange server. The EWS API lets you get this information from ExchangeFolderInfo with the FolderType enumeration introduced in this month’s release.

Getting Message Class Information using EWS: You can also get message class information from message’s summary information i.e. ExchangeMessageInfo. The information is available in the MessageInfoType property of ExchangeMessageInfo and gives the message class for the selected item.

Other Improvements

This month’s release also fixes several bugs related to API functionality. Fixing these not only improves the overall API functionality, but also stabilizes the API’s behaviors in terms of expected results.

API Resources

The following API resources can be of help to you in getting started with Aspose.Email API.