SendFlit NuGet package. It uses System.Text.Json and HttpClient, has no other dependencies, and targets .NET 6, 7 and 8.
Looking for another language? See the SDK overview.
Install
Create a client
Client implements IDisposable. Dispose it when you’re done, or create one client and reuse it for the life of your app.
Send an email
SendAsync takes an Email and returns a SendResult.
Email:
SendResult has Id, Status, and To.
Attachments
UseAttach. For text, pass a string. For binary data, pass a byte array and a content type. The SDK base64-encodes the content for you.
- Up to 10 attachments per message.
- Up to 10 MB per attachment. Larger files are rejected with
422.
Send a batch
BatchAsync sends up to 100 emails in one request and returns a List<SendResult> in the same order as your input.
ArgumentException or ArgumentOutOfRangeException before any request is made. See Batch sending.
Manage emails
The .NET SDK can list emails. It doesn’t have methods to get or cancel a single email yet. UseGET /v1/emails/{id} or DELETE /v1/emails/{id} directly if you need them.
Domains
Suppressions
"unsubscribe". See Emails.
Usage
GET /health directly if you need one.
Verify webhooks
SendFlit signs each webhook. TheX-Sendflit-Signature header carries sha256=<hex>, an HMAC-SHA256 of the raw request body. Pass the raw bytes to the static method.
Errors and retries
Failed calls throwSendFlitException, which has two properties:
429 or 5xx are retried up to maxRetries times. The SDK honors the Retry-After header when it’s present. Other 4xx responses are not retried. See Errors, retries and limits.
Method reference
Next steps
- Quickstart: send your first email from the command line.
- Batch sending: limits and per-item results.
- Webhooks: events and payloads.