MapiCalendar recurrence endafterdate

I’ve been looking at the following example for a recurring appointment to end after a given date.

What ever I seem to do the end on given date never gets populated like below

Am I missing something? I’m using the latest version.

Hi Ashley,

Thank you for contacting Aspose support team.
Following is a sample code which can be used to create such a daily recurrence which starts and end within specified date. Please give it a try and let us know the feedback.

String path = "";
string dailyfileName = Path.Combine(path, "daily.msg");
DateTime StartDate = new DateTime(2015, 6, 8);
DateTime DueDate = new DateTime(2015, 6, 30);
MapiTask task = new MapiTask("abc", "def", StartDate, DueDate);
task.State = MapiTaskState.NotAssigned;
DateTime endByDate = new DateTime(2015, 7, 1);

// Set the Daily recurrence
var recDaily = new MapiCalendarDailyRecurrencePattern
   PatternType = MapiCalendarRecurrencePatternType.Day,
   Period = 1,
   WeekStartDay = DayOfWeek.Sunday,
   EndType = MapiCalendarRecurrenceEndType.EndAfterDate,
   OccurrenceCount = GetOccurrenceCount(StartDate, endByDate, "FREQ=DAILY;INTERVAL=1"),

task.Recurrence = recDaily;
task.Save(dailyfileName, TaskSaveFormat.Msg);


Below is a screen shot of the .msg file created:

[ ](

I can’t see any end date populated? I’m using



I have tested it using our incoming release Aspose.Email for .NET 5.7.0 (expected to be released in a couple of days) and the result is as shown in the attached image. You may please wait for the new release and test the code with the new release.

We are sorry for the inconvenience caused to you in this regard.

Thanks, do you know if any of the other recurrence issues have been resolved in the next release?

Hi Ashley,

I am afraid that this information is not available right now and you may please wait for the new release as release notes will be available there. Please feel free to write us back if you have any other query in this regard.


This is still the same, this could also be related to the occurrence count method in this post:
<a href="

Below is a screen shot of the output:

I’ve also updated to the latest version


Hi Ashley,

I have tested the sample code again using Aspose.EMail for .NET 5.7.0 and get the appropriate result as mentioned earlier. Here the out MSG file is attached for your reference which you may please open in Outlook 2013 and share the feedback.

Hi, it appears correct.

Would it be possible to provide the code project you used to generate this so I can test this end? I understand I will have to reference the demo dll.

In the sample it references GetOccurrenceCount, which in this post is meant to be getting fixed in the next release (<a href=")

It would be great to see a working sample project so I can test on my computer.


Hi Ashley,

As discussed earlier, this issue seems to be due to absence of a valid license. You may please use a valid license to get expected number of recurrences in the calendar.

Please feel free to write us back for any further queries.

Thanks, found the below for reference.

Thank you for providing the feedback.