Browse our Products

Aspose.Email for .NET 24.6 Release Notes

All Changes

KeySummaryCategory
EMAILNET-41276Support for Tasks in MS GraphFeature
EMAILNET-41340Add .Abort/.Cancel methods for long-running operationsEnhancement
EMAILNET-41365Error while load .vcf fileBug
EMAILNET-41367A problem with the FindAndExtractSoftDeletedItems methodBug
EMAILNET-41363PGP encrypted MSG to MIME corrupted conversionBug
EMAILNET-41357High memory usage while sending/receiving messages using smtp/imap clientBug
EMAILNET-41358‘From’ MSG to MIME conversion issueBug
EMAILNET-41355Incorrect information when convert vcf to Distribution ListBug

New Features

Support for Task Management in Microsoft Graph

Support for Task Management in Microsoft Graph provides developers with APIs to access, manage, and interact with users’ tasks and task lists.

We added the following methods to the IGraphClient interface:

  • ListTaskLists() - Retrieves a collection of task list information.
  • GetTaskList(string id) - Retrieves a specific task list based on the provided ID.
  • DeleteTaskList(string id) - Deletes the specified task list.
  • ListTasks(string id) - Retrieves a collection of tasks associated with the specified task list ID.
  • FetchTask(string id) - Retrieves a specific task based on the provided ID.
  • CreateTask(MapiTask task, string taskListUri) - Creates a new task in the specified task list.
  • UpdateTask(MapiTask task) - Updates an existing task with the provided information.
  • UpdateTask(MapiTask task, UpdateSettings updateSettings) - Updates an existing task with specified update settings.

Code Examples

Manage Task Lists

// List Task Lists
var taskLists = graphClient.ListTaskLists();

foreach (var tList in taskLists)
{
    Console.WriteLine($"Task List: {tList.DisplayName}");
}

// Get Task List
var taskList = graphClient.GetTaskList("taskListId");

// Delete Task List
graphClient.DeleteTaskList("taskListId");

Manage Tasks

// List Tasks in a Task List
MapiTaskCollection tasks = graphClient.ListTasks("taskListId");

// Fetch Task
MapiTask task = graphClient.FetchTask("taskId");

// Create Task
var newTask = new MapiTask
{
    Subject = "New Task",
    DueDate = new DateTime(2023, 12, 31),
    Status = MapiTaskStatus.NotStarted
};

MapiTask createdTask = graphClient.CreateTask(newTask, "taskListUri");

// Update Task
createdTask.Subject = "Updated Task Subject";
MapiTask updatedTask = graphClient.UpdateTask(createdTask);

// Update Task with UpdateSettings
var updateSettings = new UpdateSettings { SkipAttachments  = true };
MapiTask updatedTaskWithSettings = graphClient.UpdateTask(createdTask, updateSettings);

Canceling Split Operations in MboxStorageReaderClass

Members for .NET Framework 4.5 and .NET Core Versions

  1. SplitInto(long chunkSize, string outputPath, CancellationToken token) - Splits the Mbox storage into smaller parts based on the specified chunk size.

    • Parameters:
      • chunkSize: The approximate size of each chunk in bytes.
      • outputPath: The folder path where the chunks will be created.
      • token: A CancellationToken that allows for the possible cancellation of the operation.
  2. SplitInto(long chunkSize, string outputPath, string partFileNamePrefix, CancellationToken token) - Splits the Mbox storage into smaller parts with a specified filename prefix for each part.

    • Parameters:
      • chunkSize: The approximate size of each chunk in bytes.
      • outputPath: The folder path where the chunks will be created.
      • partFileNamePrefix: The prefix to be added to the filename of each part.
      • token: A CancellationToken that allows for the possible cancellation of the operation.

Members for .NET Framework Versions Below 4.5

  1. SplitInto(long chunkSize, string outputPath) - Splits the Mbox storage into smaller parts based on the specified chunk size.

  2. SplitInto(long chunkSize, string outputPath, string partFileNamePrefix) - Splits the Mbox storage into smaller parts with a specified filename prefix for each part.

  3. Cancel()

    • Description: Interrupts an ongoing split operation.

Code Examples

.NET Framework 4.5 and .NET Core

int partCount = 0;

var tokenSource = new CancellationTokenSource();

var mbox = new MboxrdStorageReader(fileName, new MboxLoadOptions { LeaveOpen = false });

// Subscribe to events
mbox.MboxFileCreated += (sender, e) =>
{
    partCount++;
    if (partCount >= 5)
        tokenSource.Cancel();
};

System.Threading.Tasks.Task task = mbox.SplitInto(10000000, outputPath, tokenSource.Token);
task.Wait();

.NET Framework Below 4.5

int partCount = 0;
var mbox = new MboxrdStorageReader(fileName, new MboxLoadOptions { LeaveOpen = false });
mbox.SplitInto(10000000, outputPath);

mbox.MboxFileCreated += (sender, e) =>
{
    partCount++;
    if (partCount >= 5)
        mbox.Cancel();
};