Frequently Asked Questions

Frequently Asked Questions

Licensing & Open Source

What is the licensing model for Aspose.Email FOSS for .NET?

Aspose.Email FOSS for .NET is released under the MIT License. You can use it in personal, commercial, and open-source projects without restriction. No runtime licence key or activation is required.

Can I use Aspose.Email FOSS for .NET in a commercial product?

Yes. The MIT License permits unrestricted commercial use. No royalty payment, licence server, or internet connection is required at runtime.

Installation & Requirements

How do I install Aspose.Email FOSS for .NET?

Install via the .NET CLI:

dotnet add package Aspose.Email.Foss

Add the namespace to your source files:

using Aspose.Email.Foss.Msg;

What .NET version is required?

.NET 8.0 or later. The library does not support .NET Framework or .NET Standard. It is pure managed C# with no native dependencies and runs identically on Windows, Linux, macOS, Docker, and serverless environments.

Format Support

Which email formats are supported?

FormatReadWrite
MSG (Outlook MAPI)YesYes
CFB (Compound File Binary)YesYes
EML (MIME / RFC 5322)YesYes

Can I read EML files?

Yes. Use MapiMessage.LoadFromEml(stream) to load a standard .eml file. The built-in MIME parser handles folded headers, base64 content, and multipart messages.

Can I convert MSG to EML?

Yes. Call message.SaveToEml() for in-memory byte[] output, or message.SaveToEml(stream) to write to a stream. Subject, body, HTML body, sender, recipients, and attachments are preserved.

Is TNEF (winmail.dat) supported?

No. Only the standard MSG (CFB) and EML (MIME) formats are supported.

Is IMAP, SMTP, or POP3 supported?

No. The library handles MSG and EML files directly and does not include any network or protocol layer.

API Usage

How do I load an MSG file?

using Aspose.Email.Foss.Msg;

using var stream = File.OpenRead("message.msg");
var message = MapiMessage.FromStream(stream);
Console.WriteLine(message.Subject);

How do I create and save a new message?

var message = MapiMessage.Create("Subject", "Body");
message.SenderEmailAddress = "alice@example.com";
message.AddRecipient("bob@example.com", "Bob");
message.Save("output.msg");

How do I add attachments to a message?

// From a byte array
message.AddAttachment("file.pdf", pdfBytes, "application/pdf");

// From a stream
using var stream = File.OpenRead("photo.png");
message.AddAttachment("photo.png", stream, "image/png");

How do I convert an EML file to MSG?

using var eml = File.OpenRead("message.eml");
var message = MapiMessage.LoadFromEml(eml);
message.Save("message.msg");

How do I access the raw CFB structure?

using Aspose.Email.Foss.Cfb;

using var reader = CfbReader.FromFile("message.msg");
foreach (var entry in reader.IterChildren(CfbConstants.RootStreamId))
    Console.WriteLine(entry.Name);

Known Limitations

Are there calendar or appointment APIs?

The library handles MSG files generically. Calendar-specific properties can be accessed via SetProperty() / GetPropertyValue() with MAPI property IDs from CommonMessagePropertyId, but there is no dedicated calendar or appointment API.

Is thread safety guaranteed?

Each MapiMessage and CfbReader instance is independent. Concurrent access to separate instances from separate threads is safe. Do not share a single instance across threads without external synchronisation.

See Also

 English