Browse our Products

Aspose.Email for .NET 25.3 Release Notes

All Changes

KeySummaryCategory
EMAILNET-41512Allow Restoring ObjectData in TNEF AttachmentsFeature
EMAILNET-41511Issue with Time Zone Offset and organizer visibility in MSG calendar eventsEnhancement
EMAILNET-41529EML to HTML conversion loses spaces in textBug
EMAILNET-41537IsInline property of MapiAttachment always return false even for inline imageBug
EMAILNET-41540ArgumentOutOfRangeException while loading appointmentBug
EMAILNET-41539System.ArgumentNullException while loading appointmentBug
EMAILNET-41527The meeting response message was converted using an incorrect method type. Instead of REPLY, it was saved as REQUESTBug
EMAILNET-41524IMAP Client сrashes on invalid credentialsBug

New Features

New Methods for TNEF Attachment Handling

Aspose.Email now provides new methods for handling TNEF attachments. These methods allow saving and loading attachments in TNEF format, commonly used in Outlook messages (winmail.dat).

New Members

  • static MapiAttachment MapiAttachment.LoadFromTnef(string fileName) – Loads an attachment from a TNEF file.
  • static MapiAttachment MapiAttachment.LoadFromTnef(Stream stream) – Loads an attachment from a TNEF stream.
  • void MapiAttachment.SaveToTnef(string filename) – Saves an attachment to a TNEF file.
  • void MapiAttachment.SaveToTnef(Stream stream) – Saves an attachment to a TNEF stream.

Example Usage

// message.eml contains a winmail.dat attachment, but by default, the attachment is not preserved.
var msg = MapiMessage.Load("message.eml");

var ms = new MemoryStream();
msg.Attachments[0].SaveToTnef("winmail.dat");

ms.Position = 0;
var fromtnefAttachment = MapiAttachment.LoadFromTnef(ms);
msg.Attachments.Add(fromtnefAttachment);

fromtnefAttachment = MapiAttachment.LoadFromTnef("winmail.dat");
msg.Attachments.Add(fromtnefAttachment);

Force Setting the State of Calendar Objects

A new method has been introduced to explicitly set the state of a MapiCalendar object, overriding default behavior:

  • void MapiCalendar.SetStateForced(MapiCalendarState state)

This allows better control over calendar event states, particularly when handling received meeting requests. By default, when a meeting is created, its state is MapiCalendarState.Meeting. When received in a recipient’s inbox, it automatically changes to MapiCalendarState.Received, and its message class is updated to “IPM.Schedule.Meeting.Request”. Using SetStateForced allows manually setting the state to Received, which can be useful for preserving organizer information when saving the calendar as an MSG file. However, this may prevent proper forwarding or resending of the meeting.

Example Usage

MapiCalendar appointment = new MapiCalendar(
    "LAKE ARGYLE WA 6743",
    "Appointment",
    "This is a very important meeting :)",
    new DateTime(2024, 5, 10, 12, 30, 0, DateTimeKind.Utc),
    new DateTime(2024, 5, 10, 13, 30, 0, DateTimeKind.Utc));

appointment.Organizer = new MapiElectronicAddress
{
    EmailAddress = "test@aaa.com",
    DisplayName = "test display Name"
};

appointment.SetStateForced(MapiCalendarState.Meeting | MapiCalendarState.Received);

appointment.Save("appointment.msg", AppointmentSaveFormat.Msg);