C# / .NET SDK
The official Render25 .NET client. Targets .NET 7 and later. Fully async with Task-based APIs.
Installation
bash
dotnet add package Render25Basic Usage
Program.cs
using Render25;
var client = new Render25Client(
apiKey: Environment.GetEnvironmentVariable("RENDER25_API_KEY")!
);
var result = await client.Email.SendAsync(new SendEmailRequest
{
From = "[email protected]",
To = new[] { "[email protected]" },
Subject = "Hello from .NET",
Html = "<p>Sent via Render25 .NET SDK.</p>",
Text = "Sent via Render25 .NET SDK."
});
Console.WriteLine($"Sent: {result.Id}");Dependency Injection
Program.cs
// In Program.cs or Startup.cs
builder.Services.AddRender25(options =>
{
options.ApiKey = builder.Configuration["Render25:ApiKey"]!;
});
// In a controller or service
public class EmailService(IRender25Client client)
{
public async Task SendWelcomeAsync(string to)
{
await client.Email.SendAsync(new SendEmailRequest
{
From = "[email protected]",
To = new[] { to },
Subject = "Welcome!",
Html = "<h1>Welcome aboard.</h1>",
});
}
}