[.NET SDK]
ASP.NET Core
Send email from ASP.NET Core minimal APIs and controllers with the .NET SDK.
1
Install the .NET package
bash
dotnet add package Reloop.Email2
Send email from ASP.NET Core
send_email.cs
1using Reloop.Email;2
3var builder = WebApplication.CreateBuilder(args);4var app = builder.Build();5
6var reloop = ReloopEmail.Client(7 Environment.GetEnvironmentVariable("RELOOP_API_KEY"));8
9app.MapPost("/send", async (SendRequest req) =>10{11 var email = await reloop.Emails.SendAsync(new SendEmailRequest12 {13 From = "Acme <onboarding@yourdomain.com>",14 To = new[] { req.To },15 Subject = "Hello from ASP.NET",16 Html = "<strong>It works!</strong>"17 });18
19 return Results.Ok(new { id = email.Id });20});21
22app.Run();23
24record SendRequest(string To);3
GitHub, examples, and API reference
4
Need more help?
- Need help? Contact Support.
- Chat with Reloop developers on Discord.
- Check out our changelog.
- Questions? Contact Sales.
- LLM? Read llms.txt.
Send with ASP.NET Core.
Get an API key and ship transactional email from ASP.NET Core using the official .NET SDK.