DirectIQ 1.0.2
dotnet add package DirectIQ --version 1.0.2
NuGet\Install-Package DirectIQ -Version 1.0.2
<PackageReference Include="DirectIQ" Version="1.0.2" />
<PackageVersion Include="DirectIQ" Version="1.0.2" />
<PackageReference Include="DirectIQ" />
paket add DirectIQ --version 1.0.2
#r "nuget: DirectIQ, 1.0.2"
#:package DirectIQ@1.0.2
#addin nuget:?package=DirectIQ&version=1.0.2
#tool nuget:?package=DirectIQ&version=1.0.2
DirectIQ .NET SDK
The official .NET SDK for DirectIQ — send transactional email from .NET applications with a simple, dependency-injection-friendly client. Targets .NET 8.0+.
Installing via NuGet
Package is published on NuGet.
From the command-line:
> dotnet add package DirectIQ
From within Visual Studio using the Package Manager Console:
PM> Install-Package DirectIQ
Configure
Register the client with dependency injection at startup:
builder.Services.AddDirectIQ(o =>
{
o.ApiKey = Environment.GetEnvironmentVariable("DIRECTIQ_APIKEY")!;
});
Get your API key from the DirectIQ dashboard.
Usage
Inject IDirectIQ wherever you need to send email:
using DirectIQ;
public class FeatureImplementation
{
private readonly IDirectIQ _directiq;
public FeatureImplementation(IDirectIQ directiq)
{
_directiq = directiq;
}
public async Task Execute()
{
var message = new EmailMessage();
message.From = "from@example.com";
message.To.Add("to@example.com");
message.Subject = "Hello!";
message.HtmlBody = "<div><strong>Greetings</strong> from .NET</div>";
await _directiq.EmailSendAsync(message);
}
}
Plain text
Set TextBody instead of HtmlBody to send a plain-text email:
var message = new EmailMessage();
message.From = "from@example.com";
message.To.Add("to@example.com");
message.Subject = "Hello!";
message.TextBody = "Greetings from .NET";
await _directiq.EmailSendAsync(message);
HtmlBody takes precedence if both are set, so use one or the other rather than both.
Attachments
message.Attachments.Add(EmailAttachment.FromFile("invoice.pdf"));
Error handling
Failed requests throw a DirectIQException with the HTTP status code and raw response body:
try
{
await _directiq.EmailSendAsync(message);
}
catch (DirectIQException ex)
{
logger.LogError(ex, "DirectIQ send failed with {StatusCode}: {Body}", ex.StatusCode, ex.ResponseBody);
}
Notes
DirectIQ's transactional email API currently accepts exactly one recipient per message
(no cc, bcc, or multiple To addresses). EmailMessage.To is a collection for a
future-friendly API surface, but must contain exactly one address today.
License
MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. 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. |
-
net8.0
- Microsoft.Extensions.Http (>= 8.0.0)
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 |
|---|---|---|
| 1.0.2 | 114 | 7/31/2026 |