AI-friendly repository containing validated C# examples for Aspose.Email for .NET API.
Agent-generated C# examples for Aspose.Email for .NET — compiled, executed, and validated by an agentic pipeline. Includes an agents.md guide for AI coding agents.
products.aspose.com/email/net/
This repository provides working code examples demonstrating Aspose.Email for .NET capabilities. All examples are automatically generated, compiled, and validated using the Aspose.Email Examples Generator.
Examples are organized by feature category:
convert-between-formats/- 135 example(s)convert-thunderbird-mbox-files/- 182 example(s)programming-email-verification/- 40 example(s)programming-with-gmail/- 142 example(s)read-and-export-zimbra-tgz-files/- 30 example(s)working-with-amp-html-emails/- 44 example(s)working-with-exchange-ews-client/- 556 example(s)working-with-exchange-webdav-client/- 156 example(s)working-with-ibm-notes/- 64 example(s)working-with-imap-client/- 303 example(s)working-with-microsoft-graph-client/- 38 example(s)working-with-mime-messages/- 343 example(s)working-with-outlook-items/- 492 example(s)working-with-outlook-storage-files/- 184 example(s)working-with-pop3-client/- 40 example(s)working-with-smtp-client/- 15 example(s)zimbra/- 9 example(s)
Each category contains standalone .cs files that can be compiled and run independently.
- .NET SDK (net8.0 or compatible version)
- Aspose.Email for .NET NuGet package
- Valid Aspose license (for production use)
Each example is a self-contained C# file. To run an example:
cd <CategoryFolder>
dotnet new console -o ExampleProject
cd ExampleProject
dotnet add package Aspose.Email
# Copy the example .cs file as Program.cs
dotnet runusing Aspose.Email;
using Aspose.Email.Mime;
MailMessage message = MailMessage.Load("input.eml");
Console.WriteLine(message.Subject);if (!File.Exists(inputPath))
{
Console.Error.WriteLine($"Error: File not found – {inputPath}");
return;
}
try
{
// Operations
}
catch (Exception ex)
{
Console.Error.WriteLine($"Error: {ex.Message}");
}- Examples are single-file console applications; do not add multi-file projects.
- Dispose clients/streams with
usingwhen applicable. - Avoid hardcoding secrets or license keys.
- Aspose.Email for .NET Documentation
- API Reference
- Aspose Forum
- AI Agent Guide - For AI agents and code generation tools
All examples use Aspose.Email for .NET and require a valid license for production use. See licensing.
This repository is maintained by automated code generation. For AI-friendly guidance, see agents.md.