Free Support Forum -

Creating sendable Task in .msg file



I’m trying to create a Task trough Aspose.Email and then save it as a .msg file so it can be opened with Outlook to send to people.
I have succeeded in creating the task and saving it to .msg but the Recipients don’t seem to be used.
I saved a .msg from Outlook which behaves as I want it too: (10.2 KB)
Screenshot: image.png (13.8 KB)

This is a piece of the code I used:

MapiTask task = new MapiTask();
task.Subject = “My subject”;
task.Body = “Content”;
task.Mode = MapiTaskMode.NotAssigned;
task.Users.Owner = “Darius”;
task.Recipients.Add(“”, “name”, MapiRecipientType.MAPI_TO);

// Initial test, but doest not retain Recipients after converting to MapiMessage
//task.Save(“MapiTask.msg”, TaskSaveFormat.Msg);

MemoryStream ms = new MemoryStream();
task.Save(ms, TaskSaveFormat.Msg);
ms.Position = 0;

var message = Aspose.Email.Mapi.MapiMessage.FromStream(ms);
// Recipients are empty, add them again
message.Recipients.Add(“”, “name”, MapiRecipientType.MAPI_TO);
message.Save(“MapiTask.msg”, Aspose.Email.SaveOptions.DefaultMsgUnicode);



I have observed the message file, image and sample code shared by you. Can you please explain what else you are expecting to have in To field. You have used following statement and it added that to recipient.

task.Recipients.Add(“”, “name”, MapiRecipientType.MAPI_TO);


Hi @mudassir.fayyaz,

When I create the .msg file with the above code, I get a window like this in Outlook:
image.png (16.6 KB)

As you can see there is no Send button and the recipient is no where to be found.
Sample file: (2.0 KB)



I suggest you to please visit this documentation section for your kind reference. In case you still find issue, please feel free to share with us.


@mudassir.fayyaz I read the information you linked to but it does not provide me with a solution.
If you try out the code I posted you will see that you will not get the sender field when opening the .msg file in Outlook.



I suggest you to please visit following link for your convenience. I hope the shared information will be helpful.


@mudassir.fayyaz, thank you for the information.

We do not have access to an exchange server however…
As the .msg format clearly supports sending the task as an email, I supposed Aspose would be able to create such a file, but apparently it is not possible?