In this article you will learn how to create Outlook email messages (MSG, EML, EMLX, MHTML) in C# and how to send them synchronously or asynchronously using .NET or .NET Core. The step‑by‑step guide covers creating plain‑text messages, HTML bodies, custom encodings, and bulk sending with clear code examples.

Email remains the primary channel for business communication, document exchange, and notifications. Manually crafting each message is inefficient, especially when dealing with large recipient lists or recurring alerts. An Email Automation Service streamlines this process by programmatically generating Outlook‑compatible messages and delivering them through SMTP. After completing this guide you will be able to:
- Create and save an Outlook email in C#,
- Build an email with a rich HTML body,
- Apply specific character encoding to the message body,
- Send emails synchronously via SMTP,
- Send emails asynchronously via SMTP,
- Dispatch bulk emails efficiently.
C# API to Create and Send Outlook Emails
To automate email creation and delivery we rely on Aspose.Email for .NET, a comprehensive API that supports Outlook formats such as MSG, EML, EMLX, and MHTML. You can obtain the library by downloading the DLL or by installing it through NuGet:
PM> Install-Package Aspose.Email
After adding Aspose.Email for .NET to a C# project (Console, ASP.NET, etc.), you can start building and sending Outlook messages instantly.
Create an Outlook Email in C#
The core class for email composition is MailMessage. It provides properties for subject, sender, recipients, body, attachments, and methods to save the message in various Outlook formats. Follow these steps:
- Instantiate a
MailMessageobject. - Populate the required fields (From, To, Subject, Body).
- Call
MailMessage.Save()to write the message to disk as MSG, EML, or MHTML.
The sample below demonstrates creating a simple email and saving it as an Outlook MSG file.
Create an Outlook Email with HTML Body in C#
HTML formatting enables visually appealing emails with tables, images, and styled text. Set the MailMessage.HtmlBody property to embed full HTML markup. The example below adds a structured HTML body, including a header, paragraph, and an image placeholder.
C# Create an Outlook Email with a Particular Encoding
Specifying the correct character encoding ensures that special characters and international text render properly in the recipient’s email client. Use the MailMessage.BodyEncoding property to define the desired Encoding (e.g., UTF‑8, ISO‑8859‑1). The code snippet shows how to set UTF‑8 encoding for the email body.
Send Outlook Emails Synchronously or Asynchronously in C#
Once the MailMessage is ready, the SmtpClient class handles transmission over SMTP. Configure the client with host, port, credentials, and security options, then choose between synchronous Send or asynchronous SendAsync methods.
Send an Outlook Email Synchronously in C#
The synchronous approach blocks the calling thread until the server acknowledges the message. This is suitable for console utilities or background jobs where immediate confirmation is required.
Send an Outlook Email Asynchronously in C#
Asynchronous sending frees the calling thread, allowing UI responsiveness or parallel processing. The SendAsync method raises an event upon completion, enabling error handling and progress tracking.
Send Bulk Emails in C#
For campaigns or notifications to many recipients, use MailMessageCollection to store multiple MailMessage objects and iterate through them with a single SmtpClient. The example below illustrates bulk creation and dispatch of several Outlook messages.
Aspose Email API for C# - Live Demos
Conclusion
You now have a complete workflow for generating Outlook‑compatible emails in C# and delivering them via SMTP, both synchronously and asynchronously. Leverage the Aspose.Email for .NET documentation to explore advanced features such as email parsing, calendar integration, and server‑side processing.