Aspose.Email
24.11.0
See the version list below for details.
dotnet add package Aspose.Email --version 24.11.0
NuGet\Install-Package Aspose.Email -Version 24.11.0
<PackageReference Include="Aspose.Email" Version="24.11.0" />
paket add Aspose.Email --version 24.11.0
#r "nuget: Aspose.Email, 24.11.0"
// Install Aspose.Email as a Cake Addin #addin nuget:?package=Aspose.Email&version=24.11.0 // Install Aspose.Email as a Cake Tool #tool nuget:?package=Aspose.Email&version=24.11.0
Effortless Email Management API
Aspose.Email for .NET is a comprehensive email management API designed for developers working with Microsoft Outlook® items, MIME messages, email clients, and various protocols including SMTP, POP3, IMAP, Exchange, and Microsoft Graph. It facilitates sending and receiving emails, managing appointments, contacts, and attachments, as well as converting email files between different formats. With support for platforms such as Gmail, Zimbra, Thunderbird, and IBM Notes, Aspose.Email for .NET enables developers to create interactive AMP HTML emails, handle advanced email validation, and read Outlook storage files like PST, OST, and OLM. Whether working with cloud-based email services or handling on-premises email storage, Aspose.Email provides an efficient and flexible solution for managing email data in .NET applications.
Send Email Messages via MailGun and SendGrid
- Send email messages using MailGun or SendGrid services.
- Use
DeliveryServiceOptions
to configure service-specific settings.- Code sample to send an email synchronously and asynchronously.
- Error handling for unsuccessful email deliveries.
Working with MIME Messages
- Create and set email contents in .NET.
- Work with attachments and embedded objects.
- Extract contents from MIME messages.
- Load and save messages using
MailMessage
.- Track document conversion progress and render hyperlinks with custom styles.
Working with Appointments
- Create appointments and save them as
.msg
or.ics
.- Create appointments with HTML content.
- Load appointments in ICS format.
- Convert appointments to
MailMessage
orMapiMessage
.- Read multiple events from an ICS file.
- Write multiple events to an ICS file.
- Determine the appointment version using
Appointment.Version
.
Working with Outlook Items
- Create and save MSG files.
- Load, view, and parse MSG files.
- Manage message files using
Aspose.Email.Outlook
.- Work with voting options, follow-up flags, and due dates.
- Manage attachments, contacts, tasks, notes, calendar items, distribution lists, and recurrences.
Working with Outlook Storage Files
- Create PST files and add subfolders/messages.
- Read and convert OST files.
- Work with messages, contacts, distribution lists, calendar items, MapiTasks, MapiJournal, and MapiNote in PST.
- Split and merge PST files.
- Password protect PST files.
- Read corrupted PST/OST files and convert OLM to PST.
Working with SMTP Client
- Send emails synchronously or asynchronously using
SmtpClient
.- Perform mail merge and row-wise mail merge.
- Use multiconnection mode to send multiple messages concurrently.
- Send messages in TNEF format to preserve email formatting.
- Send meeting requests via email.
Working with POP3 Client
- Delete emails by index or delete all emails using
Pop3Client
.- Cancel deletion of messages using
Pop3Client.UndeleteMessages
.- Validate mail server credentials using
ValidateCredentials
method.
Working with IMAP Client
- Support for IMAP IDLE command to wait for new email.
- List server extensions such as IDLE, UNSELECT, and QUOTA.
- Fetch messages and list attachments.
- Validate mail server credentials.
- Log IMAP activity for debugging.
Working with Exchange EWS Client
- Send meeting requests using
EWSClient
.- Create, update, and cancel appointments.
- List appointments with paging support.
- Add events to secondary calendar folders.
- Share calendar invitations via Exchange server.
Programming with Gmail
- Create, list, delete, fetch, and update Google Calendars.
- Manage calendar access control rules (list, create, update, delete).
- Retrieve client settings and color info.
- Work with appointments: add, retrieve, update, move, and delete.
Programming with Thunderbird
- Write messages to Thunderbird storage using
MboxrdStorageWriter
.- Delete emails using
MboxClient
.
Convert Email Files using C# API
- Convert
.eml
to different formats usingAspose.Email
.- Load
.eml
files and convert them intoMailMessage
.- Convert appointments to
MailMessage
orMapiMessage
.
Working with Zimbra
- Read Zimbra TGZ storage files using
TgzReader
.- Get total items count from a TGZ file.
- Save messages with directory structure.
- Export calendar and contact items from Zimbra backup files.
Email Verification with Aspose.Email
Validate email addresses, domains, and mail servers using
Aspose.Email.Verifications
. Supports syntax-only validation, domain validation, and mail server connection validation usingEmailValidator
.
AMP HTML Email Creation
Create interactive AMP HTML emails using
AmpMessage
with components likeAmpImage
,AmpCarousel
,AmpAccordion
,AmpForm
, and more for enhanced user interaction.
Adding AMP Components
Use classes such as
AmpImage
,AmpCarousel
,AmpForm
,AmpFitText
, andAmpAccordion
to embed various interactive elements in AMP emails.
Detect NSF File Format
Detect if a file is in NSF format using
FileFormatUtil.DetectFileFormat()
.
Read Messages from NSF File
Use
NotesStorageFacility
to read messages from an NSF storage file with theEnumerateMessages
method. Note: Reading folders is not supported.
Supported File Formats
Format | Description | Load | Save |
---|---|---|---|
MSG | This format is used by Microsoft Outlook and Exchange to store email messages, contact, appointment, or other tasks. Aspose.Email supports reading, writing, and modifying MSG files. | ✔️ | ✔️ |
PST | Represents Outlook Personal Storage Files that store emails, calendar items, notes, contacts, and several other file formats. Aspose.Email allows working with PST files, including reading, writing, and manipulating data. | ✔️ | ✔️ |
OST | Represents the user’s mailbox data in offline mode on the local machine upon registration with Exchange Server using Microsoft Outlook. Aspose.Email allows working with OST files, including reading and manipulating data. | ✔️ | ✔️ |
OFT | Message template files created using Microsoft Outlook. Aspose.Email allows working with OFT files, including reading and writing. | ✔️ | ✔️ |
OLM | Format used by Microsoft Outlook for Mac for storing email messages, contacts, journals, calendar data, and other user application data. Aspose.Email supports the extraction, manipulation, and conversion of the data housed within these archives. | ✔️ | |
EML | Represents email messages saved using Outlook and other relevant applications. Aspose.Email provides support for reading and writing EML files, as well as converting them to other formats. | ✔️ | ✔️ |
EMLX | Format used by Apple Mail to store a single email message. Aspose.Email enables reading and writing of EMLX files. | ✔️ | ✔️ |
MBOX | Represents a container for a collection of electronic mail messages. Aspose.Email provides support for reading and writing MBOX files. | ✔️ | ✔️ |
ICS | The iCalendar format used for exchanging and deploying calendar events and scheduling. Aspose.Email provides support for reading and writing ICS files, allowing integration of calendar data into applications. | ✔️ | ✔️ |
VCF | Virtual Card Format is a digital file format for storing contact information. Aspose.Email allows users to read, write, and manipulate contact data. | ✔️ | ✔️ |
HTML | HTML (HyperText Markup Language) is the extension for web pages created for display in browsers. Aspose.Email equips developers with the capability to handle HTML files, facilitating the extraction and utilization of content from these files within their applications. | ✔️ | ✔️ |
MHTML | Web page archive format that saves the HTML code and associated resources in a single file. Aspose.Email supports reading MHTML files, allowing extraction of their content for use in applications. | ✔️ | ✔️ |
Supported Operating Systems
Windows
Windows Server (2003, 2008, 2012), XP, Vista, 7, 8, 8.1, 10, Windows Azure
Linux
Ubuntu, openSUSE, CentOS, and others
Mac
macOS
Supported Frameworks
.NET Frameworks
2.0 - 4.7.2, .NET Standard 2.0, .NET Core (2.0, 2.1)
Mono Framework
Mono 5.4+
Xamarin
Xamarin.Android, Xamarin.iOS, Xamarin.Mac
Development Environments
Microsoft Visual Studio
2010, 2011, 2012, 2013, 2015, 2017, 2019
Installation Steps for Aspose.Email for .NET
1. Install via NuGet
- Open Visual Studio → NuGet Package Manager.
- Search "aspose" and click "Install" for Aspose.Email.
2. Install or Update via Package Manager Console
- Open Package Manager Console (
Tools
→Library Package Manager
→Package Manager Console
). - To install:
Install-Package Aspose.Email -Version x.x.0
- To update:
Update-Package Aspose.Email
3. Reference Aspose.Email in Your Project
- In Solution Explorer, right-click
References
→Add Reference
. - Locate
Aspose.Email.dll
and add it.
4. Uninstall Aspose.Email for .NET
- Go to
Control Panel
→Add/Remove Programs
. - Select
Aspose.Email
and clickRemove
.
5. Target Specific .NET Framework Version
- Modify the configuration file (
.config
) to redirect references if targeting .NET 1.0 instead of 1.1.
Convert MSG File to EML and Preserve RTF Content
This code demonstrates how to load a MSG file, convert it to EML format, and preserve RTF content.
var loadOptions = new MsgLoadOptions
{
PreserveRtfContent = true
};
var eml = MailMessage.Load("my.msg", loadOptions);
var conversionOptions = new MailConversionOptions
{
PreserveRtfContent = true
};
var msg = MapiMessage.Load("my.msg");
var eml = msg.ToMailMessage(conversionOptions);
Retrieve Messages Asynchronously using ImapClient
This code demonstrates how to retrieve messages asynchronously from an IMAP server using Aspose.Email.
List<MailMessage> mailMessages = new List<MailMessage>();
// create mail messages
for (int i = 0; i < 100; i++)
mailMessages.Add(new MailMessage(senderEmail, receiverEmail, $"Message #{i}", "Text"));
using (ImapClient client = new ImapClient(host, 993, senderEmail, password, SecurityOptions.SSLImplicit))
{
CancellationTokenSource cancellationTokenSource = new CancellationTokenSource();
AutoResetEvent autoResetEvent = new AutoResetEvent(false);
Exception exception = null;
ThreadPool.QueueUserWorkItem(delegate
{
try
{
// start uploading the messages
var task = client.AppendMessagesAsync(mailMessages, cancellationTokenSource.Token);
AppendMessagesResult appendMessagesResult = task.GetAwaiter().GetResult();
Console.WriteLine("All messages have been appended.");
}
catch (Exception ex)
{
exception = ex;
}
finally
{
autoResetEvent.Set();
}
});
autoResetEvent.WaitOne();
}
Extract Email Attachments
This code snippet shows how to extract attachments from an email message, save them, and print the attachment names.
var eml = MailMessage.Load("Message.eml", new MsgLoadOptions());
foreach (var attachment in eml.Attachments)
{
attachment.Save("MessageEmbedded_out.eml");
Console.WriteLine(attachment.Name);
}
Tags
Email Management API
| .NET Email API
| MIME Messages
| Outlook Integration
| SMTP Protocol
| POP3 Protocol
| IMAP Protocol
| Exchange EWS
| Microsoft Graph
| Gmail API
| Thunderbird Email
| Email Conversion
| Zimbra Integration
| AMP HTML Email
| IBM Notes
| Email Validation
| Email Attachments
| Outlook PST
| OST File
| EML Conversion
| Apple Mail
| ICS Format
| Contact Management
| Calendar Events
| Xamarin Support
| Linux Compatible
| macOS Support
| HTML Format
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 is compatible. net5.0-windows was computed. net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net6.0-windows7.0 is compatible. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net20 is compatible. net35 is compatible. net35-client is compatible. net40 is compatible. net40-client is compatible. net403 was computed. net45 is compatible. net451 was computed. net452 was computed. net46 was computed. net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 2.0
- No dependencies.
-
.NETFramework 3.5
- No dependencies.
-
.NETFramework 3.5 Client
- No dependencies.
-
.NETFramework 4.0
- No dependencies.
-
.NETFramework 4.0 Client
- No dependencies.
-
.NETFramework 4.5
- No dependencies.
-
.NETStandard 2.0
- System.Security.Cryptography.Pkcs (>= 7.0.3)
- System.Text.Encoding.CodePages (>= 5.0.0)
-
net5.0
- System.Security.Cryptography.Pkcs (>= 7.0.3)
- System.Text.Encoding.CodePages (>= 5.0.0)
-
net6.0
- System.Security.Cryptography.Pkcs (>= 7.0.3)
- System.Text.Encoding.CodePages (>= 5.0.0)
-
net6.0-windows7.0
- System.Drawing.Common (>= 8.0.4)
- System.Security.Cryptography.Pkcs (>= 7.0.3)
- System.Text.Encoding.CodePages (>= 5.0.0)
NuGet packages (11)
Showing the top 5 NuGet packages that depend on Aspose.Email:
Package | Downloads |
---|---|
Aspose.Total
Aspose.Total for .NET is the most complete package of all .NET file format APIs offered by Aspose. It empowers developers to create, edit, render, print and convert between a wide range of popular document formats within any .NET, C#, ASP.NET and VB.NET applications. |
|
TresTechnologies.App.Shared
Shared components for use with applications build for the Tres API, |
|
Weavy.Core
A class library containing core business logic, data access and utility methods required by Weavy. |
|
AutomationFramework_NetCore
AT Net Core Automation Framework |
|
AsposeHelpers
Aspose helpers |
GitHub repositories (2)
Showing the top 2 popular GitHub repositories that depend on Aspose.Email:
Repository | Stars |
---|---|
aspose-words/Aspose.Words-for-.NET
Aspose.Words for .NET examples, plugins and showcases
|
|
JasonBock/Rocks
A mocking library based on the Compiler APIs (Roslyn + Mocks)
|
Version | Downloads | Last updated |
---|---|---|
24.12.0 | 229 | 12/29/2024 |
24.11.0 | 11,077 | 11/30/2024 |
24.10.0 | 19,721 | 10/31/2024 |
24.9.0 | 27,631 | 9/30/2024 |
24.8.0 | 32,740 | 8/30/2024 |
24.7.0 | 37,035 | 7/31/2024 |
24.6.0 | 41,077 | 6/30/2024 |
24.5.0 | 77,108 | 5/31/2024 |
24.4.0 | 54,636 | 4/30/2024 |
24.3.0 | 116,344 | 3/31/2024 |
24.2.0 | 43,750 | 2/29/2024 |
24.1.0 | 79,979 | 1/31/2024 |
23.12.0 | 120,476 | 12/30/2023 |
23.11.0 | 36,629 | 11/30/2023 |
23.10.0 | 60,072 | 10/31/2023 |
23.9.0 | 49,117 | 9/30/2023 |
23.8.0 | 38,416 | 8/31/2023 |
23.7.0 | 69,849 | 7/31/2023 |
23.6.0 | 46,025 | 6/30/2023 |
23.5.1 | 42,789 | 6/10/2023 |
23.5.0 | 27,052 | 5/31/2023 |
23.4.0 | 233,104 | 4/30/2023 |
23.3.0 | 60,358 | 3/31/2023 |
23.2.0 | 88,548 | 2/28/2023 |
23.1.0 | 77,536 | 1/31/2023 |
22.12.0 | 114,601 | 12/31/2022 |
22.11.0 | 63,048 | 11/30/2022 |
22.10.0 | 118,813 | 10/31/2022 |
22.9.0 | 95,882 | 9/30/2022 |
22.8.0 | 109,558 | 8/29/2022 |
22.7.0 | 62,427 | 7/30/2022 |
22.6.0 | 58,258 | 7/1/2022 |
22.5.0 | 84,761 | 5/30/2022 |
22.4.0 | 62,191 | 4/30/2022 |
22.3.0 | 68,750 | 3/31/2022 |
22.2.0 | 80,502 | 2/28/2022 |
22.1.0 | 94,065 | 1/31/2022 |
21.12.0 | 401,598 | 12/24/2021 |
21.11.0 | 32,196 | 11/26/2021 |
21.10.0 | 92,204 | 10/29/2021 |
21.9.0 | 87,864 | 9/30/2021 |
21.8.1 | 52,420 | 9/6/2021 |
21.8.0 | 30,409 | 8/31/2021 |
21.7.0 | 81,618 | 7/30/2021 |
21.6.0 | 76,450 | 6/29/2021 |
21.5.0 | 55,354 | 5/31/2021 |
21.4.0 | 74,446 | 4/30/2021 |
21.3.0 | 34,242 | 3/30/2021 |
21.2.0 | 40,228 | 2/26/2021 |
21.1.1 | 151,117 | 2/1/2021 |
21.1.0 | 18,162 | 1/28/2021 |
20.12.0 | 110,137 | 12/29/2020 |
20.11.0 | 57,512 | 11/24/2020 |
20.10.0 | 60,159 | 11/2/2020 |
20.9.1 | 20,441 | 10/1/2020 |
20.9.0 | 5,208 | 9/28/2020 |
20.8.0 | 41,685 | 8/29/2020 |
20.7.0 | 44,925 | 7/30/2020 |
20.6.0 | 126,257 | 6/29/2020 |
20.5.0 | 41,799 | 5/30/2020 |
20.4.0 | 42,148 | 4/30/2020 |
20.3.0 | 39,937 | 3/31/2020 |
20.2.0 | 78,184 | 2/27/2020 |
20.1.0 | 23,332 | 1/30/2020 |
19.12.0 | 41,036 | 12/27/2019 |
19.11.0 | 228,422 | 11/29/2019 |
19.10.0 | 15,714 | 10/30/2019 |
19.9.0 | 63,472 | 9/28/2019 |
19.8.0 | 34,722 | 8/28/2019 |
19.7.0 | 14,780 | 7/30/2019 |
19.6.0 | 18,440 | 6/29/2019 |
19.5.0 | 46,246 | 6/1/2019 |
19.4.0 | 9,656 | 4/26/2019 |
19.3.0 | 11,537 | 3/29/2019 |
19.2.0 | 19,011 | 2/27/2019 |
19.1.1 | 8,582 | 2/4/2019 |
19.1.0 | 6,094 | 1/31/2019 |
18.12.0 | 22,323 | 12/25/2018 |
18.11.0 | 52,715 | 11/29/2018 |
18.10.0 | 11,204 | 10/24/2018 |
18.9.0 | 8,846 | 9/27/2018 |
18.8.0 | 11,407 | 8/27/2018 |
18.7.0 | 15,323 | 7/27/2018 |
18.6.0 | 18,351 | 6/27/2018 |
18.5.1 | 12,427 | 5/25/2018 |
18.4.0 | 9,806 | 4/26/2018 |
18.3.0 | 18,211 | 3/24/2018 |
18.2.0 | 21,682 | 2/21/2018 |
18.1.0 | 14,320 | 1/18/2018 |
17.12.0 | 46,347 | 12/18/2017 |
17.11.0 | 98,135 | 11/14/2017 |
17.10.0 | 22,363 | 10/9/2017 |
17.9.0 | 10,275 | 9/11/2017 |
17.8.0 | 34,706 | 8/8/2017 |
17.7.0 | 10,280 | 7/7/2017 |
17.6.0 | 17,636 | 6/8/2017 |
17.5.0 | 13,326 | 5/9/2017 |
17.4.0 | 55,152 | 4/7/2017 |
17.3.0 | 33,417 | 3/23/2017 |
17.2.0 | 19,363 | 2/16/2017 |
17.1.0 | 21,652 | 1/17/2017 |
16.12.0 | 316,368 | 12/19/2016 |
16.11.0 | 4,303 | 11/10/2016 |
16.10.0 | 19,033 | 10/10/2016 |
6.9.0 | 10,016 | 9/9/2016 |
6.8.0 | 23,944 | 8/10/2016 |
6.7.0 | 47,238 | 7/8/2016 |
6.6.0 | 10,615 | 6/4/2016 |
6.5.0 | 4,592 | 5/6/2016 |
6.4.0 | 22,167 | 4/11/2016 |
6.3.0 | 8,262 | 3/7/2016 |
6.2.0 | 85,905 | 2/5/2016 |
6.1.0 | 8,294 | 12/31/2015 |
6.0.0 | 5,662 | 12/7/2015 |
5.9.1 | 3,910 | 11/26/2015 |
5.9.0 | 16,334 | 11/5/2015 |
5.8.0 | 41,378 | 10/7/2015 |
5.7.0 | 5,423 | 9/8/2015 |
5.6.0 | 24,095 | 8/8/2015 |
5.5.0 | 14,934 | 7/9/2015 |
5.4.0 | 4,580 | 6/9/2015 |
5.3.0 | 6,550 | 5/5/2015 |
5.2.0 | 4,159 | 4/6/2015 |
5.1.0 | 3,512 | 3/10/2015 |
5.0.0 | 6,124 | 2/9/2015 |
4.9.0 | 6,066 | 1/4/2015 |
4.8.0 | 6,312 | 12/4/2014 |
4.7.0 | 4,283 | 11/3/2014 |
4.6.0 | 3,231 | 10/6/2014 |
4.5.0 | 6,197 | 9/4/2014 |
4.4.0 | 40,094 | 7/30/2014 |
4.3.0 | 6,957 | 7/2/2014 |
4.2.0 | 3,226 | 6/2/2014 |
4.1.0 | 3,518 | 5/2/2014 |
4.0.0 | 7,578 | 3/28/2014 |
3.9.0 | 5,195 | 3/2/2014 |
3.8.0 | 7,903 | 1/28/2014 |
3.7.0 | 24,642 | 12/30/2013 |
3.6.0 | 5,991 | 11/27/2013 |
3.5.0 | 3,443 | 11/1/2013 |
3.4.0 | 3,359 | 10/1/2013 |
3.3.0 | 3,436 | 8/26/2013 |
3.2.0 | 3,158 | 7/29/2013 |
3.1.0 | 3,446 | 6/27/2013 |
3.0.0 | 4,712 | 5/29/2013 |
2.9.0 | 3,871 | 4/29/2013 |
2.8.0 | 6,098 | 3/26/2013 |
2.7.0 | 4,490 | 2/27/2013 |
2.6.0 | 3,320 | 1/28/2013 |
2.5.0 | 3,323 | 12/26/2012 |
2.4.0 | 3,260 | 11/27/2012 |
2.3.0 | 5,652 | 10/30/2012 |
2.2.0 | 3,388 | 9/27/2012 |
2.1.0 | 6,953 | 8/29/2012 |
2.0.0 | 3,298 | 7/30/2012 |
1.9.0 | 3,402 | 6/28/2012 |
1.8.0 | 3,203 | 5/27/2012 |
1.7.1 | 4,872 | 5/9/2012 |
1.7.0 | 3,007 | 4/29/2012 |
1.6.0 | 3,062 | 3/26/2012 |
1.5.0 | 3,136 | 2/24/2012 |
1.4.0.1 | 3,128 | 2/16/2012 |
1.4.0 | 3,658 | 2/2/2012 |
1.3.0 | 5,492 | 1/24/2012 |