.NET Client
The official .NET SDK for VaultSandbox Gateway. It handles quantum-safe encryption automatically, letting you focus on testing email workflows.
Key Capabilities
Section titled “Key Capabilities”- Automatic Encryption: ML-KEM-768 key encapsulation + AES-256-GCM encryption handled transparently
- Real-Time Delivery: SSE-based email delivery with smart polling fallback
- Email Authentication: Built-in SPF/DKIM/DMARC validation helpers
- Full Email Access: Decrypted content, headers, links, and attachments
- Dependency Injection: First-class ASP.NET Core
IServiceCollectionintegration
Requirements
Section titled “Requirements”- .NET 9.0+ (not supported in Blazor WebAssembly or browser runtimes)
- VaultSandbox Gateway server
- Valid API key
Gateway Server
Section titled “Gateway Server”The SDK connects to a VaultSandbox Gateway - a receive-only SMTP server you self-host. It handles email reception, authentication validation, and encryption. You can run one with Docker in minutes.
See Gateway Overview or jump to Quick Start to deploy one.
Quick Example
Section titled “Quick Example”using VaultSandbox.Client;
var client = VaultSandboxClientBuilder.Create() .WithBaseUrl("https://gateway.example.com") .WithApiKey("your-api-key") .Build();
// Create inbox (keypair generated automatically)var inbox = await client.CreateInboxAsync();
// Send email to inbox.EmailAddress from your application...
// Wait for emailvar email = await inbox.WaitForEmailAsync(new WaitForEmailOptions{ Timeout = TimeSpan.FromSeconds(30)});
Console.WriteLine($"Subject: {email.Subject}");Console.WriteLine($"Text: {email.Text}");
// Cleanupawait client.DeleteInboxAsync(inbox.EmailAddress);await client.DisposeAsync();Next Steps
Section titled “Next Steps”- Installation - Install the SDK
- Configuration - Client options and setup
- Core Concepts - Inboxes, emails, and authentication
- API Reference - Full API documentation