# Read, Write, and Convert Email and Outlook Files

OfficeIMO.Email reads and writes EML, MSG, OFT, TNEF, PST, OST, OLM, mbox, calendar and contact files in .NET, with no Outlook installed.

**Packages**

- [OfficeIMO.Email](https://www.nuget.org/packages/OfficeIMO.Email) `dotnet add package OfficeIMO.Email`

**Works with**

- .NET
- [PowerShell](/docs/pswriteoffice/install/) `Install-Module PSWriteOffice`
- [CLI](/docs/cli/install/) `dotnet tool install --global OfficeIMO.Tool`

**Target frameworks**

netstandard2.0, net10.0, net472

**APIs**

- [`EmailDocument`](/api/email/officeimo-email-emaildocument/)
- [`EmailStoreSession`](/api/email/officeimo-email-store-emailstoresession/)
- [`IcsDocument`](/api/email/officeimo-email-icsdocument/)
- [`VCardDocument`](/api/email/officeimo-email-vcarddocument/)
- [`EmailConversionLossPolicy`](/api/email/officeimo-email-emailconversionlosspolicy/)
- [`EmailDiagnostic`](/api/email/officeimo-email-emaildiagnostic/)
- [`EmailWriteResult`](/api/email/officeimo-email-emailwriteresult/)
- [`EmailWriterOptions`](/api/email/officeimo-email-emailwriteroptions/)

**Cmdlets**

- [`Open-OfficeEmail`](/api/powershell/open-officeemail/)
- [`Save-OfficeEmail`](/api/powershell/save-officeemail/)

**Commands**

- [`officeimo convert`](/docs/cli/convert/)

**Limits**

[OfficeIMO.Email support matrix](/compatibility/#package-email)

**Verified**

Examples compiled against the source on 2026-11-14

**Data**

- [OfficeIMO.Email API index](/api/email/index.json)
- [PSWriteOffice command catalog](/data/powershell/commands.json)
- [CLI command catalog](/data/cli/commands.json)
- [Capability catalog (JSON)](/data/capabilities.json)

`OfficeIMO.Email` works with saved email and Outlook data without Outlook, COM, or third-party message parsers. Use `EmailDocument` for single messages (EML/MIME, MSG, OFT, TNEF), `EmailStoreSession` for mailbox stores, and `IcsDocument` or `VCardDocument` for calendars and contacts.

| You want to | Page |
|---|---|
| Read or convert EML, MSG, OFT, TNEF, or `winmail.dat` | [Read and Convert Email Messages](/docs/email/messages-and-conversion/) |
| Read PST, OST, OLM, mbox, EMLX, Apple Mail, or Maildir, or convert a store to PST | [Read and Convert PST, OST, and Mailbox Stores](/docs/email/mailbox-stores/) |
| Read or update ICS, vCalendar, vCard, or Outlook recurrence | [Read and Edit Calendars, Contacts, and Outlook Items](/docs/email/calendars-and-contacts/) |
| Limit untrusted input, read diagnostics, or verify a migration | [Read Untrusted Email Safely and Verify Conversions](/docs/email/safety-and-verification/) |

For text extraction across many formats rather than format-specific editing, use the [Reader](/docs/reader/).

## Convert one message

`Save` picks the output format from the extension. A conversion that would lose protected content, recurrence data, or another known semantic is blocked unless you accept the loss explicitly.

### C#

```csharp
using OfficeIMO.Email;

EmailDocument message = EmailDocument.Load("message.msg");
Console.WriteLine(message.Subject);
Console.WriteLine(message.Body.Text);
var options = new EmailWriterOptions(EmailConversionLossPolicy.Warn);
EmailWriteResult converted = message.Save("message.eml", options);
foreach (EmailDiagnostic diagnostic in converted.Diagnostics) {
    Console.WriteLine(diagnostic.Message);
}
```

### PowerShell

```powershell
$options = New-OfficeEmailWriterOptions -AllowLoss
$converted = Open-OfficeEmail -Path .\message.msg |
    Save-OfficeEmail -Path .\message.eml -Options $options -PassThru
$converted.Diagnostics
```

Use the C# and PowerShell loss options after reviewing what EML cannot carry.

### CLI

```sh
officeimo convert message.msg message.eml
```

The CLI reports Outlook-specific metadata that EML cannot carry. Add `--require-no-loss` to leave the destination unchanged when that omission is detected.

## What the package covers

| Family | Formats and operations |
|---|---|
| Messages | EML/MIME, MSG, OFT, TNEF, attachments, embedded messages, inline resources, HTML, plain text, and RTF bodies |
| Outlook items | Messages, appointments, contacts, tasks, journals, sticky notes, meeting items, and distribution lists |
| Stores | mboxo, mboxrd, PST, OST, OLM, EMLX, Apple Mail, Maildir, and mailbox directories |
| Calendars and contacts | ICS, vCalendar, vCard 2.1/3.0/4.0, recurrence, time zones, and reminders |
| Address books | Outlook Offline Address Book discovery, v4 entry decoding, search, and offline identity resolution |
| Verification | Structured diagnostics, bounded I/O, conversion analysis, semantic fingerprints, and comparison reports |

<!-- PowerForge markdown source sha256:DE819F631B7DE7991921A0793CBA2FD68253C70DCD3902B2F1B9ADAD97AC7745; title=True -->

<!-- PowerForge markdown artifact sha256:30648585CD991F2F6B47148012AF13B29A5DEC5DE8DFED85BC49A05EB6E15D05 -->
