SmtpClient is deprecated. HttpClient is not.
System.Net.Mail.SmtpClient carries a warning straight from Microsoft: don't use it for new development. The suggested alternatives are third-party mail libraries, which means dependencies, SMTP credentials, and connection management, or the HTTP path with zero of those.
One POST, and the send is handled
using var http = new HttpClient(); http.DefaultRequestHeaders.Authorization = new("Bearer", Environment.GetEnvironmentVariable("NITROSEND_API_KEY")); await http.PostAsJsonAsync( "https://api.nitrosend.com/v1/my/messages", new { from = "[email protected]", to = "[email protected]", subject = "Welcome", html = "<p>You're in.</p>" });
ASP.NET Core, a worker service, or a console app: same call, one env var, and the anonymous object serializes itself.
One craft note from a decade of sends: if your email is mostly images, Gmail and Outlook cannot read it, so they guess, and the guess is the promotions tab or spam. Alt text on every image tells the inbox what the message is, and it changes where you land. We consider it important enough that the platform auto-fixes missing template alt text for you.
Full parameters, responses, and error codes live in the REST API docs and the API reference.
And the part no library gives you
The same account exposes an MCP server, so the agent writing your code can also run your email. Point Claude, Cursor, or Codex at api.nitrosend.com/mcp and it composes, previews, and stages sends, with a human approving every one. The API is for your code. The MCP is for your agent. One platform either way.
Every send comes back with a message ID, and delivery events follow on your webhook: delivered, opened, bounced. No dashboard required to know what happened.