.NET SDK
The official .NET client. Targets .NET 8.
Install
Section titled “Install”dotnet add package Duta.Netusing Duta;
var duta = new DutaClient("duta_live_xxx");
var result = await duta.Emails.SendAsync(new SendEmailOptions{ From = "hello@yourdomain.com", To = new[] { "user@example.com" }, Subject = "Welcome", Html = "<p>Thanks for signing up!</p>",});
Console.WriteLine($"Sent: {result.Id}");Error handling
Section titled “Error handling”Methods throw DutaException on failure:
try{ await duta.Emails.SendAsync(options);}catch (DutaException e){ Console.WriteLine($"{e.StatusCode} {e.Name}: {e.Message}"); // e.Name: authentication_error | permission_denied | rate_limit_exceeded | ...}Methods
Section titled “Methods”duta.Emails.SendAsync(options): send an email. ReturnsSendEmailResult.duta.Emails.GetAsync(id): retrieve an email. Requires a full-access key.duta.Emails.ListAsync(page, limit): list emails. Requires a full-access key.
Pass your own HttpClient to the constructor to reuse a shared instance in long-running apps.
Package: nuget.org/packages/Duta.Net · Source: github.com/indra-sh/duta-dotnet.