agentleFS
Sign inSign up

agentic-net-examples / convert-between-formats

aspose-email/agentic-net-examples/convert-between-formats/AGENTS.md

C# examples for convert-between-formats using Aspose.Email for .NET

AGENTS.md2 starsChanged 5 months ago
---
name: convert-between-formats
description: C# examples for convert-between-formats using Aspose.Email for .NET
language: csharp
framework: net8.0
parent: ../AGENTS.md
---

# AGENTS - convert-between-formats

## Persona
You are a C# developer working in the **convert-between-formats** category.
This folder contains standalone C# examples for this category.
See the root [AGENTS.md](../AGENTS.md) for repository-wide conventions.

## Scope
- Examples for **convert-between-formats**.
- Files are standalone `.cs` examples stored directly in this folder.

## Required Namespaces
- `using System;` (135 file(s))
- `using System.IO;` (135 file(s))
- `using Aspose.Email;` (135 file(s))
- `using Aspose.Email.Mapi;` (46 file(s))
- `using Aspose.Words;` (37 file(s))
- `using Aspose.Words.Saving;` (25 file(s))
- `using Aspose.Email.Storage.Pst;` (13 file(s))
- `using System.Collections.Generic;` (11 file(s))
- `using Aspose.Email.Calendar;` (9 file(s))
- `using Aspose.Email.Storage.Mbox;` (8 file(s))
- `using System.Text;` (8 file(s))
- `using System.Text.RegularExpressions;` (8 file(s))
- `using Aspose.Email.Storage;` (7 file(s))
- `using Aspose.Email.PersonalInfo;` (3 file(s))
- `using System.IO.Compression;` (2 file(s))
- `using HtmlAgilityPack;` (2 file(s))
- `using Aspose.Words.Drawing;` (1 file(s))
- `using Aspose.Words.Tables;` (1 file(s))
- `using System.Threading.Tasks;` (1 file(s))
- `using Aspose.Email.Tools;` (1 file(s))
- `using Aspose.Email.Mime;` (1 file(s))
- `using Aspose.Email.Calendar.Recurrences;` (1 file(s))

## Files in this folder
| File | Description |
|------|-------------|
| [batch-convert-a-collection-of-mhtml-files-to-eml-preserving-original-file-timestamps-in-metadata.cs](./batch-convert-a-collection-of-mhtml-files-to-eml-preserving-original-file-timestamps-in-metadata.cs) | batch convert a collection of mhtml files to eml preserving original file timestamps in metadata |
| [batch-convert-a-collection-of-oft-files-to-pdf-adding-a-watermark-text-indicating-confidential-status.cs](./batch-convert-a-collection-of-oft-files-to-pdf-adding-a-watermark-text-indicating-confidential-status.cs) | batch convert a collection of oft files to pdf adding a watermark text indicating confidential status |
| [batch-convert-all-mhtml-files-in-a-folder-to-pst-creating-a-folder-hierarchy-based-on-filenames.cs](./batch-convert-all-mhtml-files-in-a-folder-to-pst-creating-a-folder-hierarchy-based-on-filenames.cs) | batch convert all mhtml files in a folder to pst creating a folder hierarchy based on filenames |
| [batch-convert-all-pst-subfolders-to-individual-eml-files-maintaining-the-original-folder-hierarchy-on-disk.cs](./batch-convert-all-pst-subfolders-to-individual-eml-files-maintaining-the-original-folder-hierarchy-on-disk.cs) | batch convert all pst subfolders to individual eml files maintaining the original folder hierarchy on disk |
| [batch-convert-msg-files-to-html-applying-a-user-defined-template-that-adds-a-company-header-to-each-page.cs](./batch-convert-msg-files-to-html-applying-a-user-defined-template-that-adds-a-company-header-to-each-page.cs) | batch convert msg files to html applying a user defined template that adds a company header to each page |
| [batch-convert-multiple-mbox-files-to-vcf-grouping-contacts-by-organization-and-creating-separate-files-per-group.cs](./batch-convert-multiple-mbox-files-to-vcf-grouping-contacts-by-organization-and-creating-separate-files-per-group.cs) | batch convert multiple mbox files to vcf grouping contacts by organization and creating separate files per group |
| [batch-process-a-directory-of-ics-files-converting-each-to-eml-with-standardized-subject-prefixes.cs](./batch-process-a-directory-of-ics-files-converting-each-to-eml-with-standardized-subject-prefixes.cs) | batch process a directory of ics files converting each to eml with standardized subject prefixes |
| [batch-process-a-folder-of-eml-files-compress-each-resulting-pdf-and-store-them-in-a-timestamped-archive.cs](./batch-process-a-folder-of-eml-files-compress-each-resulting-pdf-and-store-them-in-a-timestamped-archive.cs) | batch process a folder of eml files compress each resulting pdf and store them in a timestamped archive |
| [batch-process-a-folder-of-mhtml-files-converting-each-to-both-eml-and-msg-formats-simultaneously.cs](./batch-process-a-folder-of-mhtml-files-converting-each-to-both-eml-and-msg-formats-simultaneously.cs) | batch process a folder of mhtml files converting each to both eml and msg formats simultaneously |
| [batch-process-mbox-files-converting-each-to-a-separate-pst-file-named-after-the-original-mailbox.cs](./batch-process-mbox-files-converting-each-to-a-separate-pst-file-named-after-the-original-mailbox.cs) | batch process mbox files converting each to a separate pst file named after the original mailbox |
| [configure-an-htmlsaveoptions-object-with-custom-rendering-and-resource-settings-to-convert-an-eml-file-to-html.cs](./configure-an-htmlsaveoptions-object-with-custom-rendering-and-resource-settings-to-convert-an-eml-file-to-html.cs) | configure an htmlsaveoptions object with custom rendering and resource settings to convert an eml file to html |
| [convert-a-batch-of-eml-files-in-a-directory-to-pdf-documents-with-inline-attachment-rendering.cs](./convert-a-batch-of-eml-files-in-a-directory-to-pdf-documents-with-inline-attachment-rendering.cs) | convert a batch of eml files in a directory to pdf documents with inline attachment rendering |
| [convert-a-collection-of-msg-files-to-pdf-while-embedding-original-attachments-as-clickable-icons-within-the-document.cs](./convert-a-collection-of-msg-files-to-pdf-while-embedding-original-attachments-as-clickable-icons-within-the-document.cs) | convert a collection of msg files to pdf while embedding original attachments as clickable icons within the document |
| [convert-a-meeting-request-from-an-msg-file-to-an-icalendar-file-preserving-attendees-and-time-zone-information.cs](./convert-a-meeting-request-from-an-msg-file-to-an-icalendar-file-preserving-attendees-and-time-zone-information.cs) | convert a meeting request from an msg file to an icalendar file preserving attendees and time zone information |
| [convert-a-set-of-msg-files-to-pdf-with-ocr-applied-to-scanned-image-attachments-for-searchable-text.cs](./convert-a-set-of-msg-files-to-pdf-with-ocr-applied-to-scanned-image-attachments-for-searchable-text.cs) | convert a set of msg files to pdf with ocr applied to scanned image attachments for searchable text |
| [convert-a-signed-s-mime-email-to-pdf-while-preserving-the-visual-representation-of-the-digital-signature.cs](./convert-a-signed-s-mime-email-to-pdf-while-preserving-the-visual-representation-of-the-digital-signature.cs) | convert a signed s mime email to pdf while preserving the visual representation of the digital signature |
| [convert-an-email-containing-a-calendar-invitation-to-a-pdf-that-includes-both-message-body-and-calendar-details.cs](./convert-an-email-containing-a-calendar-invitation-to-a-pdf-that-includes-both-message-body-and-calendar-details.cs) | convert an email containing a calendar invitation to a pdf that includes both message body and calendar details |
| [convert-an-email-with-embedded-images-to-plain-text-replacing-images-with-descriptive-alt-text-placeholders.cs](./convert-an-email-with-embedded-images-to-plain-text-replacing-images-with-descriptive-alt-text-placeholders.cs) | convert an email with embedded images to plain text replacing images with descriptive alt text placeholders |
| [convert-an-eml-file-to-html-format-while-retaining-the-original-message-date-by-setting-preserveoriginaldate-to-true.cs](./convert-an-eml-file-to-html-format-while-retaining-the-original-message-date-by-setting-preserveoriginaldate-to-true.cs) | convert an eml file to html format while retaining the original message date by setting preserveoriginaldate to true |
| [convert-an-eml-file-to-html-while-saving-attachments-by-setting-saveattachments-true.cs](./convert-an-eml-file-to-html-while-saving-attachments-by-setting-saveattachments-true.cs) | convert an eml file to html while saving attachments by setting saveattachments true |
| [convert-an-html-email-to-jpeg-format-applying-compression-quality-settings-to-balance-file-size-and-clarity.cs](./convert-an-html-email-to-jpeg-format-applying-compression-quality-settings-to-balance-file-size-and-clarity.cs) | convert an html email to jpeg format applying compression quality settings to balance file size and clarity |
| [convert-an-html-email-to-mhtml-embedding-all-external-resources-to-create-a-single-self-contained-file.cs](./convert-an-html-email-to-mhtml-embedding-all-external-resources-to-create-a-single-self-contained-file.cs) | convert an html email to mhtml embedding all external resources to create a single self contained file |
| [convert-an-html-message-to-eml-format-ensuring-all-embedded-images-are-retained-as-attachments.cs](./convert-an-html-message-to-eml-format-ensuring-all-embedded-images-are-retained-as-attachments.cs) | convert an html message to eml format ensuring all embedded images are retained as attachments |
| [convert-an-mhtml-document-to-html-with-custom-css-using-htmlformatoptions-before-saving.cs](./convert-an-mhtml-document-to-html-with-custom-css-using-htmlformatoptions-before-saving.cs) | convert an mhtml document to html with custom css using htmlformatoptions before saving |
| [convert-an-mhtml-email-containing-embedded-images-to-emlx-while-embedding-images-as-separate-attachments.cs](./convert-an-mhtml-email-containing-embedded-images-to-emlx-while-embedding-images-as-separate-attachments.cs) | convert an mhtml email containing embedded images to emlx while embedding images as separate attachments |
| [convert-an-mhtml-email-to-emlx-format-while-preserving-the-original-character-encoding.cs](./convert-an-mhtml-email-to-emlx-format-while-preserving-the-original-character-encoding.cs) | convert an mhtml email to emlx format while preserving the original character encoding |
| [convert-an-mhtml-email-to-vcf-by-extracting-contact-information-from-the-signature-block.cs](./convert-an-mhtml-email-to-vcf-by-extracting-contact-information-from-the-signature-block.cs) | convert an mhtml email to vcf by extracting contact information from the signature block |
| [convert-an-mhtml-file-to-oft-template-format-for-use-in-outlook-mail-merge-operations.cs](./convert-an-mhtml-file-to-oft-template-format-for-use-in-outlook-mail-merge-operations.cs) | convert an mhtml file to oft template format for use in outlook mail merge operations |
| [convert-an-msg-message-to-an-ics-calendar-file-using-enhanced-conversion-capabilities-including-loading-and-saving-operations.cs](./convert-an-msg-message-to-an-ics-calendar-file-using-enhanced-conversion-capabilities-including-loading-and-saving-operations.cs) | convert an msg message to an ics calendar file using enhanced conversion capabilities including loading and saving operations |
| [convert-an-oft-file-to-mhtml-embedding-all-linked-resources-to-produce-a-single-portable-email-file.cs](./convert-an-oft-file-to-mhtml-embedding-all-linked-resources-to-produce-a-single-portable-email-file.cs) | convert an oft file to mhtml embedding all linked resources to produce a single portable email file |
| [convert-an-oft-file-to-plain-text-stripping-all-formatting-while-retaining-attachment-filenames-for-reference.cs](./convert-an-oft-file-to-plain-text-stripping-all-formatting-while-retaining-attachment-filenames-for-reference.cs) | convert an oft file to plain text stripping all formatting while retaining attachment filenames for reference |
| [convert-an-oft-file-to-xps-format-preserving-page-layout-and-vector-graphics-for-high-quality-printing.cs](./convert-an-oft-file-to-xps-format-preserving-page-layout-and-vector-graphics-for-high-quality-printing.cs) | convert an oft file to xps format preserving page layout and vector graphics for high quality printing |
| [convert-an-oft-template-to-pdf-flattening-form-fields-while-retaining-visual-appearance-of-interactive-elements.cs](./convert-an-oft-template-to-pdf-flattening-form-fields-while-retaining-visual-appearance-of-interactive-elements.cs) | convert an oft template to pdf flattening form fields while retaining visual appearance of interactive elements |
| [convert-html-content-into-an-mbox-file-by-loading-the-html-and-exporting-it-as-mbox.cs](./convert-html-content-into-an-mbox-file-by-loading-the-html-and-exporting-it-as-mbox.cs) | convert html content into an mbox file by loading the html and exporting it as mbox |
| [convert-html-email-to-pdf-customizing-metadata-fields-such-as-author-title-and-subject-during-export.cs](./convert-html-email-to-pdf-customizing-metadata-fields-such-as-author-title-and-subject-during-export.cs) | convert html email to pdf customizing metadata fields such as author title and subject during export |
| [convert-html-email-to-pdf-preserving-hyperlink-functionality-so-links-remain-clickable-in-the-resulting-document.cs](./convert-html-email-to-pdf-preserving-hyperlink-functionality-so-links-remain-clickable-in-the-resulting-document.cs) | convert html email to pdf preserving hyperlink functionality so links remain clickable in the resulting document |
| [convert-html-email-to-pdf-with-accessibility-tags-enabling-screen-readers-to-interpret-document-structure.cs](./convert-html-email-to-pdf-with-accessibility-tags-enabling-screen-readers-to-interpret-document-structure.cs) | convert html email to pdf with accessibility tags enabling screen readers to interpret document structure |
| [convert-html-email-to-plain-text-stripping-all-html-tags-while-preserving-line-breaks-and-spacing.cs](./convert-html-email-to-plain-text-stripping-all-html-tags-while-preserving-line-breaks-and-spacing.cs) | convert html email to plain text stripping all html tags while preserving line breaks and spacing |
| [convert-html-emails-to-pdf-while-embedding-a-custom-footer-containing-page-numbers-and-generation-date.cs](./convert-html-emails-to-pdf-while-embedding-a-custom-footer-containing-page-numbers-and-generation-date.cs) | convert html emails to pdf while embedding a custom footer containing page numbers and generation date |
| [convert-html-to-pdf-applying-compression-settings-to-reduce-file-size-while-maintaining-visual-quality.cs](./convert-html-to-pdf-applying-compression-settings-to-reduce-file-size-while-maintaining-visual-quality.cs) | convert html to pdf applying compression settings to reduce file size while maintaining visual quality |
| [convert-html-to-pdf-applying-css-media-query-handling-to-adjust-layout-for-print-media.cs](./convert-html-to-pdf-applying-css-media-query-handling-to-adjust-layout-for-print-media.cs) | convert html to pdf applying css media query handling to adjust layout for print media |
| [convert-html-to-pdf-embedding-fonts-to-ensure-consistent-rendering-across-different-operating-systems.cs](./convert-html-to-pdf-embedding-fonts-to-ensure-consistent-rendering-across-different-operating-systems.cs) | convert html to pdf embedding fonts to ensure consistent rendering across different operating systems |
| [convert-mbox-messages-to-emlx-format-and-organize-output-files-into-subfolders-by-sender-domain.cs](./convert-mbox-messages-to-emlx-format-and-organize-output-files-into-subfolders-by-sender-domain.cs) | convert mbox messages to emlx format and organize output files into subfolders by sender domain |
| [convert-mbox-messages-to-high-resolution-tiff-images-preserving-original-email-layout-and-fonts.cs](./convert-mbox-messages-to-high-resolution-tiff-images-preserving-original-email-layout-and-fonts.cs) | convert mbox messages to high resolution tiff images preserving original email layout and fonts |
| [convert-mbox-messages-to-html-and-embed-each-email-original-timestamp-as-a-visible-header.cs](./convert-mbox-messages-to-html-and-embed-each-email-original-timestamp-as-a-visible-header.cs) | convert mbox messages to html and embed each email original timestamp as a visible header |
| [convert-multiple-html-emails-to-eml-in-parallel-utilizing-asynchronous-api-calls-to-improve-performance.cs](./convert-multiple-html-emails-to-eml-in-parallel-utilizing-asynchronous-api-calls-to-improve-performance.cs) | convert multiple html emails to eml in parallel utilizing asynchronous api calls to improve performance |
| [create-a-custom-htmlformatoptions-instance-to-embed-css-inline-before-converting-mhtml-to-html.cs](./create-a-custom-htmlformatoptions-instance-to-embed-css-inline-before-converting-mhtml-to-html.cs) | create a custom htmlformatoptions instance to embed css inline before converting mhtml to html |
| [create-a-custom-saveoptions-for-eml-conversion-that-forces-utf-8-encoding-for-all-output-files.cs](./create-a-custom-saveoptions-for-eml-conversion-that-forces-utf-8-encoding-for-all-output-files.cs) | create a custom saveoptions for eml conversion that forces utf 8 encoding for all output files |
| [create-a-custom-saveoptions-instance-to-set-email-priority-when-converting-mhtml-to-msg.cs](./create-a-custom-saveoptions-instance-to-set-email-priority-when-converting-mhtml-to-msg.cs) | create a custom saveoptions instance to set email priority when converting mhtml to msg |
| [create-a-message-from-raw-html-content-insert-it-into-an-ost-file-and-persist-the-updated-ost.cs](./create-a-message-from-raw-html-content-insert-it-into-an-ost-file-and-persist-the-updated-ost.cs) | create a message from raw html content insert it into an ost file and persist the updated ost |
| [create-a-new-ost-storage-and-add-an-mhtml-message-to-a-specific-folder-using-addmessage.cs](./create-a-new-ost-storage-and-add-an-mhtml-message-to-a-specific-folder-using-addmessage.cs) | create a new ost storage and add an mhtml message to a specific folder using addmessage |
| [export-an-oft-template-as-a-series-of-png-images-one-per-page-with-configurable-resolution.cs](./export-an-oft-template-as-a-series-of-png-images-one-per-page-with-configurable-resolution.cs) | export an oft template as a series of png images one per page with configurable resolution |
| [export-the-body-of-an-email-to-a-markdown-file-converting-html-elements-to-appropriate-markdown-syntax.cs](./export-the-body-of-an-email-to-a-markdown-file-converting-html-elements-to-appropriate-markdown-syntax.cs) | export the body of an email to a markdown file converting html elements to appropriate markdown syntax |
| [extract-all-attachments-from-a-msg-file-and-store-them-in-a-zip-archive-preserving-original-filenames.cs](./extract-all-attachments-from-a-msg-file-and-store-them-in-a-zip-archive-preserving-original-filenames.cs) | extract all attachments from a msg file and store them in a zip archive preserving original filenames |
| [extract-calendar-event-data-from-an-mhtml-file-and-save-it-as-an-ics-file.cs](./extract-calendar-event-data-from-an-mhtml-file-and-save-it-as-an-ics-file.cs) | extract calendar event data from an mhtml file and save it as an ics file |
| [extract-calendar-events-from-a-pst-file-and-export-them-to-separate-icalendar-files-named-by-event-title.cs](./extract-calendar-events-from-a-pst-file-and-export-them-to-separate-icalendar-files-named-by-event-title.cs) | extract calendar events from a pst file and export them to separate icalendar files named by event title |
| [extract-contact-cards-from-mbox-messages-and-save-each-as-an-individual-vcf-file.cs](./extract-contact-cards-from-mbox-messages-and-save-each-as-an-individual-vcf-file.cs) | extract contact cards from mbox messages and save each as an individual vcf file |
| [extract-embedded-vcard-data-from-an-mhtml-file-and-write-it-to-a-vcf-file.cs](./extract-embedded-vcard-data-from-an-mhtml-file-and-write-it-to-a-vcf-file.cs) | extract embedded vcard data from an mhtml file and write it to a vcf file |
| [extract-the-email-body-strip-all-html-tags-and-write-the-result-to-a-txt-file.cs](./extract-the-email-body-strip-all-html-tags-and-write-the-result-to-a-txt-file.cs) | extract the email body strip all html tags and write the result to a txt file |
| [generate-a-pdf-a-1b-document-from-html-content-applying-archival-compliance-settings-for-long-term-storage.cs](./generate-a-pdf-a-1b-document-from-html-content-applying-archival-compliance-settings-for-long-term-storage.cs) | generate a pdf a 1b document from html content applying archival compliance settings for long term storage |
| [generate-a-pdf-a-2b-document-from-an-oft-file-ensuring-compliance-with-electronic-records-regulations.cs](./generate-a-pdf-a-2b-document-from-an-oft-file-ensuring-compliance-with-electronic-records-regulations.cs) | generate a pdf a 2b document from an oft file ensuring compliance with electronic records regulations |
| [generate-a-pdf-report-summarizing-email-metadata-such-as-subject-sender-and-received-date-for-each-msg-file.cs](./generate-a-pdf-report-summarizing-email-metadata-such-as-subject-sender-and-received-date-for-each-msg-file.cs) | generate a pdf report summarizing email metadata such as subject sender and received date for each msg file |
| [generate-pdf-from-html-applying-a-color-profile-to-ensure-accurate-color-reproduction-on-professional-printers.cs](./generate-pdf-from-html-applying-a-color-profile-to-ensure-accurate-color-reproduction-on-professional-printers.cs) | generate pdf from html applying a color profile to ensure accurate color reproduction on professional printers |
| [generate-pdf-from-html-with-custom-page-size-and-orientation-supporting-landscape-and-portrait-layouts.cs](./generate-pdf-from-html-with-custom-page-size-and-orientation-supporting-landscape-and-portrait-layouts.cs) | generate pdf from html with custom page size and orientation supporting landscape and portrait layouts |
| [load-a-batch-of-html-files-from-a-directory-and-convert-each-to-pdf-with-uniform-page-margins.cs](./load-a-batch-of-html-files-from-a-directory-and-convert-each-to-pdf-with-uniform-page-margins.cs) | load a batch of html files from a directory and convert each to pdf with uniform page margins |
| [load-a-collection-of-msg-files-filter-messages-by-sender-domain-and-export-matching-items-to-html.cs](./load-a-collection-of-msg-files-filter-messages-by-sender-domain-and-export-matching-items-to-html.cs) | load a collection of msg files filter messages by sender domain and export matching items to html |
| [load-a-msg-file-and-export-its-contents-to-an-html-document-while-preserving-formatting-and-attachments.cs](./load-a-msg-file-and-export-its-contents-to-an-html-document-while-preserving-formatting-and-attachments.cs) | load a msg file and export its contents to an html document while preserving formatting and attachments |
| [load-a-msg-file-and-serialize-it-directly-to-an-eml-format-preserving-all-message-properties.cs](./load-a-msg-file-and-serialize-it-directly-to-an-eml-format-preserving-all-message-properties.cs) | load a msg file and serialize it directly to an eml format preserving all message properties |
| [load-an-email-apply-a-css-stylesheet-to-its-html-body-and-save-the-styled-output-as-mhtml.cs](./load-an-email-apply-a-css-stylesheet-to-its-html-body-and-save-the-styled-output-as-mhtml.cs) | load an email apply a css stylesheet to its html body and save the styled output as mhtml |
| [load-an-email-apply-a-custom-header-transformation-and-save-the-modified-message-as-an-emlx-file.cs](./load-an-email-apply-a-custom-header-transformation-and-save-the-modified-message-as-an-emlx-file.cs) | load an email apply a custom header transformation and save the modified message as an emlx file |
| [load-an-email-from-a-stream-convert-to-html-and-write-the-result-into-a-memory-buffer.cs](./load-an-email-from-a-stream-convert-to-html-and-write-the-result-into-a-memory-buffer.cs) | load an email from a stream convert to html and write the result into a memory buffer |
| [load-an-email-remove-all-inline-images-and-save-the-cleaned-message-as-an-eml-file.cs](./load-an-email-remove-all-inline-images-and-save-the-cleaned-message-as-an-eml-file.cs) | load an email remove all inline images and save the cleaned message as an eml file |
| [load-an-email-with-an-embedded-video-convert-to-pdf-and-replace-the-video-with-a-thumbnail-image.cs](./load-an-email-with-an-embedded-video-convert-to-pdf-and-replace-the-video-with-a-thumbnail-image.cs) | load an email with an embedded video convert to pdf and replace the video with a thumbnail image |
| [load-an-email-with-unicode-characters-ensure-proper-utf-8-encoding-and-save-it-as-an-emlx-file.cs](./load-an-email-with-unicode-characters-ensure-proper-utf-8-encoding-and-save-it-as-an-emlx-file.cs) | load an email with unicode characters ensure proper utf 8 encoding and save it as an emlx file |
| [load-an-eml-email-message-then-serialize-and-save-its-content-as-an-mhtml-file.cs](./load-an-eml-email-message-then-serialize-and-save-its-content-as-an-mhtml-file.cs) | load an eml email message then serialize and save its content as an mhtml file |
| [load-an-eml-message-and-convert-it-into-an-mbox-file-preserving-all-message-headers.cs](./load-an-eml-message-and-convert-it-into-an-mbox-file-preserving-all-message-headers.cs) | load an eml message and convert it into an mbox file preserving all message headers |
| [load-an-eml-message-and-export-its-contents-as-an-html-file-preserving-formatting-and-attachments.cs](./load-an-eml-message-and-export-its-contents-as-an-html-file-preserving-formatting-and-attachments.cs) | load an eml message and export its contents as an html file preserving formatting and attachments |
| [load-an-eml-message-and-export-its-embedded-contact-information-as-a-vcf-file.cs](./load-an-eml-message-and-export-its-embedded-contact-information-as-a-vcf-file.cs) | load an eml message and export its embedded contact information as a vcf file |
| [load-an-eml-message-and-save-it-as-html-with-utf-8-output-encoding-correctly.cs](./load-an-eml-message-and-save-it-as-html-with-utf-8-output-encoding-correctly.cs) | load an eml message and save it as html with utf 8 output encoding correctly |
| [load-an-eml-message-and-serialize-it-directly-into-an-oft-file-format-for-further-processing.cs](./load-an-eml-message-and-serialize-it-directly-into-an-oft-file-format-for-further-processing.cs) | load an eml message and serialize it directly into an oft file format for further processing |
| [load-an-eml-message-append-it-to-a-pst-store-and-then-persist-the-updated-pst-file.cs](./load-an-eml-message-append-it-to-a-pst-store-and-then-persist-the-updated-pst-file.cs) | load an eml message append it to a pst store and then persist the updated pst file |
| [load-an-eml-message-convert-it-to-ost-format-and-save-the-resulting-file-to-the-specified-location.cs](./load-an-eml-message-convert-it-to-ost-format-and-save-the-resulting-file-to-the-specified-location.cs) | load an eml message convert it to ost format and save the resulting file to the specified location |
| [load-an-eml-message-embed-its-linked-resources-and-export-the-content-as-a-standalone-html-file.cs](./load-an-eml-message-embed-its-linked-resources-and-export-the-content-as-a-standalone-html-file.cs) | load an eml message embed its linked resources and export the content as a standalone html file |
| [load-an-eml-message-into-memory-and-serialize-it-directly-to-an-msg-file-while-preserving-all-properties.cs](./load-an-eml-message-into-memory-and-serialize-it-directly-to-an-msg-file-while-preserving-all-properties.cs) | load an eml message into memory and serialize it directly to an msg file while preserving all properties |
| [load-an-eml-message-transform-its-contents-and-export-it-as-an-ics-calendar-file.cs](./load-an-eml-message-transform-its-contents-and-export-it-as-an-ics-calendar-file.cs) | load an eml message transform its contents and export it as an ics calendar file |
| [load-an-html-document-and-export-it-as-mhtml-while-applying-custom-mhtformatoptions-settings.cs](./load-an-html-document-and-export-it-as-mhtml-while-applying-custom-mhtformatoptions-settings.cs) | load an html document and export it as mhtml while applying custom mhtformatoptions settings |
| [load-an-html-document-and-save-it-as-mhtml-while-retaining-the-original-date-preserveoriginaldate-true.cs](./load-an-html-document-and-save-it-as-mhtml-while-retaining-the-original-date-preserveoriginaldate-true.cs) | load an html document and save it as mhtml while retaining the original date preserveoriginaldate true |
| [load-an-html-document-and-serialize-it-directly-to-an-oft-file-preserving-original-formatting.cs](./load-an-html-document-and-serialize-it-directly-to-an-oft-file-preserving-original-formatting.cs) | load an html document and serialize it directly to an oft file preserving original formatting |
| [load-an-html-document-and-serialize-its-content-into-an-outlook-msg-file-preserving-formatting-and-metadata.cs](./load-an-html-document-and-serialize-its-content-into-an-outlook-msg-file-preserving-formatting-and-metadata.cs) | load an html document and serialize its content into an outlook msg file preserving formatting and metadata |
| [load-an-html-document-parse-its-contact-data-and-generate-an-equivalent-vcf-vcard-file.cs](./load-an-html-document-parse-its-contact-data-and-generate-an-equivalent-vcf-vcard-file.cs) | load an html document parse its contact data and generate an equivalent vcf vcard file |
| [load-an-html-document-then-export-it-as-mhtml-with-saveallheaders-set-to-false-to-retain-all-headers.cs](./load-an-html-document-then-export-it-as-mhtml-with-saveallheaders-set-to-false-to-retain-all-headers.cs) | load an html document then export it as mhtml with saveallheaders set to false to retain all headers |
| [load-an-html-document-using-htmlloadoptions-and-export-it-directly-to-mhtml-format-preserving-content-fidelity.cs](./load-an-html-document-using-htmlloadoptions-and-export-it-directly-to-mhtml-format-preserving-content-fidelity.cs) | load an html document using htmlloadoptions and export it directly to mhtml format preserving content fidelity |
| [load-an-html-email-file-and-convert-it-to-pdf-while-preserving-original-layout.cs](./load-an-html-email-file-and-convert-it-to-pdf-while-preserving-original-layout.cs) | load an html email file and convert it to pdf while preserving original layout |
| [load-an-html-file-and-convert-its-contents-into-an-icalendar-ics-file-format.cs](./load-an-html-file-and-convert-its-contents-into-an-icalendar-ics-file-format.cs) | load an html file and convert its contents into an icalendar ics file format |
| [load-an-html-file-and-export-it-directly-to-the-target-format-such-as-pdf-docx-or-xlsx.cs](./load-an-html-file-and-export-it-directly-to-the-target-format-such-as-pdf-docx-or-xlsx.cs) | load an html file and export it directly to the target format such as pdf docx or xlsx |
| [load-an-html-file-and-serialize-it-to-an-eml-message-preserving-the-original-email-structure.cs](./load-an-html-file-and-serialize-it-to-an-eml-message-preserving-the-original-email-structure.cs) | load an html file and serialize it to an eml message preserving the original email structure |
| [load-an-html-file-into-memory-and-serialize-it-directly-to-an-mhtml-document-preserving-all-resources.cs](./load-an-html-file-into-memory-and-serialize-it-directly-to-an-mhtml-document-preserving-all-resources.cs) | load an html file into memory and serialize it directly to an mhtml document preserving all resources |
| [load-an-html-message-and-save-it-as-an-emlx-file-using-the-appropriate-api-methods.cs](./load-an-html-message-and-save-it-as-an-emlx-file-using-the-appropriate-api-methods.cs) | load an html message and save it as an emlx file using the appropriate api methods |
| [load-an-ics-file-modify-the-appointment-location-and-save-the-updated-event-as-msg.cs](./load-an-ics-file-modify-the-appointment-location-and-save-the-updated-event-as-msg.cs) | load an ics file modify the appointment location and save the updated event as msg |
| [load-an-mhtml-file-and-save-it-as-eml-using-saveoptions-defaulteml-while-preserving-attachments.cs](./load-an-mhtml-file-and-save-it-as-eml-using-saveoptions-defaulteml-while-preserving-attachments.cs) | load an mhtml file and save it as eml using saveoptions defaulteml while preserving attachments |
| [load-an-mhtml-file-convert-inline-images-to-base64-and-save-as-html-for-web-embedding.cs](./load-an-mhtml-file-convert-inline-images-to-base64-and-save-as-html-for-web-embedding.cs) | load an mhtml file convert inline images to base64 and save as html for web embedding |
| [load-an-mhtml-file-detect-embedded-calendar-invites-and-export-them-as-separate-vcf-contacts.cs](./load-an-mhtml-file-detect-embedded-calendar-invites-and-export-them-as-separate-vcf-contacts.cs) | load an mhtml file detect embedded calendar invites and export them as separate vcf contacts |
| [load-an-mhtml-file-remove-all-script-tags-and-save-the-cleaned-content-as-html.cs](./load-an-mhtml-file-remove-all-script-tags-and-save-the-cleaned-content-as-html.cs) | load an mhtml file remove all script tags and save the cleaned content as html |
| [load-an-mhtml-file-replace-all-font-families-with-arial-and-save-the-result-as-msg.cs](./load-an-mhtml-file-replace-all-font-families-with-arial-and-save-the-result-as-msg.cs) | load an mhtml file replace all font families with arial and save the result as msg |
| [load-an-mhtml-file-replace-all-image-sources-with-placeholder-urls-and-save-as-html.cs](./load-an-mhtml-file-replace-all-image-sources-with-placeholder-urls-and-save-as-html.cs) | load an mhtml file replace all image sources with placeholder urls and save as html |
| [load-an-mhtml-file-replace-all-inline-css-with-external-stylesheet-references-then-save-as-html.cs](./load-an-mhtml-file-replace-all-inline-css-with-external-stylesheet-references-then-save-as-html.cs) | load an mhtml file replace all inline css with external stylesheet references then save as html |
| [load-an-mhtml-file-strip-all-html-comments-and-save-the-cleaned-version-as-html.cs](./load-an-mhtml-file-strip-all-html-comments-and-save-the-cleaned-version-as-html.cs) | load an mhtml file strip all html comments and save the cleaned version as html |
| [load-an-msg-email-file-and-save-its-contents-as-an-oft-template-while-preserving-all-message-properties.cs](./load-an-msg-email-file-and-save-its-contents-as-an-oft-template-while-preserving-all-message-properties.cs) | load an msg email file and save its contents as an oft template while preserving all message properties |
| [load-an-msg-file-and-export-its-contents-as-an-ics-calendar-file-while-preserving-event-data.cs](./load-an-msg-file-and-export-its-contents-as-an-ics-calendar-file-while-preserving-event-data.cs) | load an msg file and export its contents as an ics calendar file while preserving event data |
| [load-an-msg-file-and-export-its-contents-to-html-using-advanced-conversion-capabilities.cs](./load-an-msg-file-and-export-its-contents-to-html-using-advanced-conversion-capabilities.cs) | load an msg file and export its contents to html using advanced conversion capabilities |
| [load-an-msg-message-file-and-serialize-it-as-an-emlx-file-preserving-all-message-properties.cs](./load-an-msg-message-file-and-serialize-it-as-an-emlx-file-preserving-all-message-properties.cs) | load an msg message file and serialize it as an emlx file preserving all message properties |
| [load-an-msg-message-file-and-serialize-it-as-an-mht-mhtml-document-preserving-all-content.cs](./load-an-msg-message-file-and-serialize-it-as-an-mht-mhtml-document-preserving-all-content.cs) | load an msg message file and serialize it as an mht mhtml document preserving all content |
| [load-an-oft-template-and-convert-it-to-msg-injecting-custom-sender-and-recipient-fields-programmatically.cs](./load-an-oft-template-and-convert-it-to-msg-injecting-custom-sender-and-recipient-fields-programmatically.cs) | load an oft template and convert it to msg injecting custom sender and recipient fields programmatically |
| [load-an-outlook-msg-file-and-save-it-as-an-eml-message-preserving-all-headers.cs](./load-an-outlook-msg-file-and-save-it-as-an-eml-message-preserving-all-headers.cs) | load an outlook msg file and save it as an eml message preserving all headers |
| [load-html-content-create-a-message-containing-it-add-the-message-to-a-pst-file-and-save-the-pst.cs](./load-html-content-create-a-message-containing-it-add-the-message-to-a-pst-file-and-save-the-pst.cs) | load html content create a message containing it add the message to a pst file and save the pst |
| [load-msg-email-files-in-c-and-save-them-to-the-desired-target-formats-such-as-pdf-docx-or-eml.cs](./load-msg-email-files-in-c-and-save-them-to-the-desired-target-formats-such-as-pdf-docx-or-eml.cs) | load msg email files in c and save them to the desired target formats such as pdf docx or eml |
| [load-msg-files-and-convert-them-to-mbox-format-utilizing-advanced-conversion-options-while-preserving-metadata.cs](./load-msg-files-and-convert-them-to-mbox-format-utilizing-advanced-conversion-options-while-preserving-metadata.cs) | load msg files and convert them to mbox format utilizing advanced conversion options while preserving metadata |
| [process-a-folder-of-oft-templates-converting-each-to-msg-while-applying-a-common-email-signature.cs](./process-a-folder-of-oft-templates-converting-each-to-msg-while-applying-a-common-email-signature.cs) | process a folder of oft templates converting each to msg while applying a common email signature |
| [read-a-msg-email-file-and-serialize-its-contents-into-an-mbox-mailbox-format.cs](./read-a-msg-email-file-and-serialize-its-contents-into-an-mbox-mailbox-format.cs) | read a msg email file and serialize its contents into an mbox mailbox format |
| [read-a-pst-archive-extract-each-email-and-export-them-individually-to-mhtml-format-preserving-formatting.cs](./read-a-pst-archive-extract-each-email-and-export-them-individually-to-mhtml-format-preserving-formatting.cs) | read a pst archive extract each email and export them individually to mhtml format preserving formatting |
| [read-a-pst-file-via-streaming-convert-each-message-to-pdf-and-write-output-to-a-network-share.cs](./read-a-pst-file-via-streaming-convert-each-message-to-pdf-and-write-output-to-a-network-share.cs) | read a pst file via streaming convert each message to pdf and write output to a network share |
| [read-an-email-from-a-database-blob-convert-to-html-and-update-the-record-with-the-new-markup.cs](./read-an-email-from-a-database-blob-convert-to-html-and-update-the-record-with-the-new-markup.cs) | read an email from a database blob convert to html and update the record with the new markup |
| [read-an-encrypted-eml-message-using-a-password-decrypt-it-and-save-the-clear-text-version-as-msg.cs](./read-an-encrypted-eml-message-using-a-password-decrypt-it-and-save-the-clear-text-version-as-msg.cs) | read an encrypted eml message using a password decrypt it and save the clear text version as msg |
| [render-an-html-email-as-a-high-resolution-png-image-configuring-dpi-and-background-color-options.cs](./render-an-html-email-as-a-high-resolution-png-image-configuring-dpi-and-background-color-options.cs) | render an html email as a high resolution png image configuring dpi and background color options |
| [render-html-email-as-pdf-a-3-embedding-original-attachments-within-the-pdf-for-archival-purposes.cs](./render-html-email-as-pdf-a-3-embedding-original-attachments-within-the-pdf-for-archival-purposes.cs) | render html email as pdf a 3 embedding original attachments within the pdf for archival purposes |
| [save-a-loaded-emlx-email-as-a-pdf-a-1b-document-ensuring-font-embedding-for-long-term-preservation.cs](./save-a-loaded-emlx-email-as-a-pdf-a-1b-document-ensuring-font-embedding-for-long-term-preservation.cs) | save a loaded emlx email as a pdf a 1b document ensuring font embedding for long term preservation |
| [transform-a-calendar-item-from-an-msg-file-into-an-icalendar-ics-file-while-retaining-recurrence-rules.cs](./transform-a-calendar-item-from-an-msg-file-into-an-icalendar-ics-file-while-retaining-recurrence-rules.cs) | transform a calendar item from an msg file into an icalendar ics file while retaining recurrence rules |
| [transform-a-multi-part-mime-message-into-a-single-pdf-document-merging-all-text-and-attachment-contents.cs](./transform-a-multi-part-mime-message-into-a-single-pdf-document-merging-all-text-and-attachment-contents.cs) | transform a multi part mime message into a single pdf document merging all text and attachment contents |
| [transform-an-html-email-into-msg-format-preserving-custom-headers-and-message-flags-during-conversion.cs](./transform-an-html-email-into-msg-format-preserving-custom-headers-and-message-flags-during-conversion.cs) | transform an html email into msg format preserving custom headers and message flags during conversion |
| [transform-an-oft-file-into-eml-format-preserving-all-embedded-attachments-and-preserving-original-timestamps.cs](./transform-an-oft-file-into-eml-format-preserving-all-embedded-attachments-and-preserving-original-timestamps.cs) | transform an oft file into eml format preserving all embedded attachments and preserving original timestamps |
| [transform-an-oft-template-into-rtf-document-preserving-text-styling-and-embedded-objects-during-conversion.cs](./transform-an-oft-template-into-rtf-document-preserving-text-styling-and-embedded-objects-during-conversion.cs) | transform an oft template into rtf document preserving text styling and embedded objects during conversion |
| [transform-html-content-to-pdf-configuring-image-scaling-to-prevent-oversized-graphics-from-breaking-page-layout.cs](./transform-html-content-to-pdf-configuring-image-scaling-to-prevent-oversized-graphics-from-breaking-page-layout.cs) | transform html content to pdf configuring image scaling to prevent oversized graphics from breaking page layout |
| [transform-html-email-to-pdf-extracting-and-listing-all-urls-in-a-separate-appendix-page-for-reference.cs](./transform-html-email-to-pdf-extracting-and-listing-all-urls-in-a-separate-appendix-page-for-reference.cs) | transform html email to pdf extracting and listing all urls in a separate appendix page for reference |
| [transform-html-email-to-pdf-inserting-a-table-of-contents-based-on-heading-hierarchy-for-navigation.cs](./transform-html-email-to-pdf-inserting-a-table-of-contents-based-on-heading-hierarchy-for-navigation.cs) | transform html email to pdf inserting a table of contents based on heading hierarchy for navigation |
| [transform-html-messages-to-pdf-with-ocr-layer-enabling-searchable-text-extraction-from-embedded-images.cs](./transform-html-messages-to-pdf-with-ocr-layer-enabling-searchable-text-extraction-from-embedded-images.cs) | transform html messages to pdf with ocr layer enabling searchable text extraction from embedded images |

## Category Statistics
- Total examples: 135

## General Tips
- Follow root boundaries and testing guide.
- Dispose client objects; avoid hardcoded secrets; prefer explicit types.

<!-- AUTOGENERATED:START -->
| Date | Run ID | Branch/Commit |
|------|--------|---------------|
| 2026-09-14 | `auto` | examples/batch-auto |
<!-- AUTOGENERATED:END -->

Discussion

Did this work in your project? Say what you used it for and what you changed. People and their agents can both post here.

Posts are public.Sign in to post

No one has posted yet. Be the first.