IBeam.Communications.Email.PickupDirectory 2.9.0

dotnet add package IBeam.Communications.Email.PickupDirectory --version 2.9.0
                    
NuGet\Install-Package IBeam.Communications.Email.PickupDirectory -Version 2.9.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="IBeam.Communications.Email.PickupDirectory" Version="2.9.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="IBeam.Communications.Email.PickupDirectory" Version="2.9.0" />
                    
Directory.Packages.props
<PackageReference Include="IBeam.Communications.Email.PickupDirectory" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add IBeam.Communications.Email.PickupDirectory --version 2.9.0
                    
#r "nuget: IBeam.Communications.Email.PickupDirectory, 2.9.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package IBeam.Communications.Email.PickupDirectory@2.9.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=IBeam.Communications.Email.PickupDirectory&version=2.9.0
                    
Install as a Cake Addin
#tool nuget:?package=IBeam.Communications.Email.PickupDirectory&version=2.9.0
                    
Install as a Cake Tool

IBeam.Communications.Email.PickupDirectory

IBeam.Communications.Email.PickupDirectory implements IEmailService by writing .eml email files to a local pickup directory. It is intended for local development, integration tests, QA inspection, and environments where you want to verify generated email without sending it to real recipients.

When To Use This

  • You want to inspect email output without delivering it.
  • You need a simple local/test email provider.
  • You want automated tests to verify generated .eml files.
  • You are developing templates and want fast feedback.

Do not treat this package as a production email delivery provider.

What This Package Contains

Area Type(s) Purpose
Email provider PickupDirectoryEmailService Writes EmailMessage as mail files through SmtpClient pickup-directory delivery.
Provider options PickupDirectoryEmailOptions Holds directory path and default sender settings.
DI registration AddIBeamPickupDirectoryEmail(IConfiguration) Registers pickup-directory options and IEmailService.
Validation Startup option validation plus message validation Catches missing directory/sender settings and invalid messages.
Error translation EmailProviderException, EmailConfigurationException, EmailValidationException Surfaces filesystem and validation failures through IBeam exception types.

Architecture Fit

API <-- DTO/model object --> Service <-- Entity --> Repository

This provider belongs behind the service layer. It should not contain business decisions. Consuming services decide when email should be sent, and this provider writes the message to disk for inspection.

Quick Start

using IBeam.Communications.Abstractions;
using IBeam.Communications.Email.PickupDirectory;

builder.Services.AddIBeamCommunications(builder.Configuration);
builder.Services.AddIBeamPickupDirectoryEmail(builder.Configuration);

Configuration:

{
  "IBeam": {
    "Communications": {
      "Email": {
        "FromAddress": "noreply@example.test",
        "FromName": "Local Test App",
        "PickupDirectory": {
          "DirectoryPath": "artifacts/email",
          "DefaultFromAddress": "noreply@example.test",
          "DefaultFromDisplayName": "Local Test App"
        }
      }
    }
  }
}

Send email:

public sealed class LocalEmailPreviewService
{
    private readonly IEmailService _email;

    public LocalEmailPreviewService(IEmailService email)
    {
        _email = email;
    }

    public Task WritePreviewAsync(string to, CancellationToken ct = default)
    {
        var message = new EmailMessage
        {
            Subject = "Preview",
            HtmlBody = "<p>This message will be written as an .eml file.</p>"
        };
        message.To.Add(to);

        return _email.SendAsync(message, ct: ct);
    }
}

Configuration

Setting Default Purpose
IBeam:Communications:Email:PickupDirectory:DirectoryPath required Directory where .eml files are written. Created automatically when possible.
IBeam:Communications:Email:PickupDirectory:DefaultFromAddress required Provider-level default sender address.
IBeam:Communications:Email:PickupDirectory:DefaultFromDisplayName null Provider-level default sender display name.
IBeam:Communications:Email:FromAddress empty Shared sender fallback used by IBeam sender resolution.
IBeam:Communications:Email:FromName null Shared sender display-name fallback.

Service Operations, Auditing, And Permissions

Pickup-directory writes are still provider delivery, not the business operation. Tag the consuming service method that generates the email.

[IBeamOperation("notifications.preview.generate")]
public Task GeneratePreviewAsync(Guid tenantId, Guid notificationId, CancellationToken ct = default)
    => _operations.ExecuteAsync(
        this,
        token => GeneratePreviewCoreAsync(tenantId, notificationId, token),
        new ServiceOperationExecutionOptions
        {
            TenantId = tenantId,
            EntityId = notificationId
        },
        ct);

Data Storage

This package writes .eml files to the configured directory. It does not create database tables.

Storage Item Created By This Package Notes
Pickup directory Yes, if missing Created with Directory.CreateDirectory.
.eml files Yes Files are written by SmtpClient pickup-directory delivery.
Azure Table Storage tables No No table schema is owned by this package.
Email outbox/history No Add an application repository if durable tracking is needed.

Extension Points

Extension Point Interface Why Replace It
Email provider IEmailService Replace pickup directory with SMTP, SendGrid, ACS, or custom delivery.
Directory configuration PickupDirectoryEmailOptions Point local/test output to a stable inspection folder.
Template rendering IEmailTemplateRenderer Generate .eml output from templates for local QA.

Package Relationships

Package Relationship
IBeam.Communications Shared email contracts, models, and sender defaults.
IBeam.Communications.Email.PickupDirectory Local/test email provider implementation.
IBeam.Communications.Email.Templating Optional template renderer useful with pickup output.

Extended Examples And Agent Guidance

Troubleshooting

Problem Likely Cause Fix
Startup fails with DirectoryPath is required Missing pickup directory setting Configure IBeam:Communications:Email:PickupDirectory:DirectoryPath.
Files are not written Directory is wrong or process lacks write access Check absolute resolved path and process permissions.
Sender validation fails Missing default sender Configure pickup-directory and/or shared email sender defaults.
Test files pile up Directory is not cleaned between test runs Clean the configured folder as part of test setup.

Version Notes

  • Targets net10.0.
  • Intended for development/test/QA inspection, not production delivery.
  • Package version is assigned by the repository release workflow.
Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.9.0 33 7/21/2026
2.8.2 37 7/21/2026
2.8.1 32 7/21/2026
2.8.0 38 7/21/2026
2.7.0 37 7/21/2026
2.6.0 43 7/20/2026
2.5.0 58 7/17/2026
2.4.2 87 7/16/2026
2.4.1 91 7/14/2026
2.4.0 105 6/24/2026
2.3.0 94 6/24/2026
2.2.0 111 6/23/2026
2.1.0 109 6/23/2026
2.0.68 101 6/23/2026
2.0.66 105 6/22/2026
2.0.65 104 6/22/2026
2.0.64 105 6/17/2026
2.0.63 113 6/16/2026
2.0.62 107 6/16/2026
2.0.57 121 6/8/2026
Loading failed