FAQ — Aspose.Email FOSS for .NET

FAQ — Aspose.Email FOSS for .NET

Licensing

What license does Aspose.Email.Foss use?

MIT license. No license key is required. Use freely in personal, commercial, and open-source projects.


Installation

How do I install Aspose.Email.Foss?

dotnet add package Aspose.Email.Foss

What .NET version is required?

.NET 8.0 or later. The library does not support .NET Framework or .NET Standard.

Are there native dependencies?

No. The library is pure managed C# with no native dependencies. It runs identically on Windows, Linux, macOS, Docker, and serverless environments.


Format Support

Which email formats are supported?

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

Can I read EML files?

Yes. Use MapiMessage.LoadFromEml(stream) to load a standard .eml file into a MapiMessage. 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 file. Subject, body, HTML body, sender, recipients, and all attachments are preserved.

Is TNEF (winmail.dat) supported?

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

Is IMAP/SMTP/POP3 supported?

No. The library handles MSG files directly and does not include any network/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 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?

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

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

How do I convert EML 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 any unimplemented methods?

No intentionally unimplemented stubs exist in the current version.

Is calendar/appointment support available?

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 synchronization.

 English