Requires .NET Standard 2.0+ / .NET 6+ and
System.Text.JsonInstallation
Install using NuGet:Copy
Ask AI
dotnet add package SendSculpt.Sdk
Quick Start
Initialize the client with your API Key.Copy
Ask AI
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using SendSculpt;
class Program
{
static async Task Main(string[] args)
{
var client = new SendSculptClient("your-api-key");
var request = new SendEmailRequest
{
To = new List<string> { "recipient@example.com" },
Subject = "Welcome to SendSculpt!",
FromEmail = "noreply@yourdomain.com",
BodyHtml = "<h1>Hello!</h1><p>This is a test from C#</p>"
};
try
{
var response = await client.SendEmailAsync(request);
Console.WriteLine($"Email sent successfully: {response.MessageId}");
}
catch (Exception ex)
{
Console.WriteLine($"Error sending email: {ex.Message}");
}
}
}
Advanced Usage
Send emails utilizing SendSculpt Templates and auto-encoded Attachments.Copy
Ask AI
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using SendSculpt;
class Program
{
static async Task Main(string[] args)
{
var client = new SendSculptClient("your-api-key");
var request = new SendEmailRequest
{
To = new List<string> { "recipient@example.com" },
Subject = "Monthly Invoice",
FromEmail = "billing@yourdomain.com",
TemplateId = "your-template-id",
TemplateData = new Dictionary<string, object>
{
{ "first_name", "John" },
{ "amount", 49.99 }
},
Attachments = new List<Attachment>
{
new Attachment
{
Filename = "invoice.pdf",
FilePath = "/path/to/local/invoice.pdf", // Auto-converted to Base64
MimeType = "application/pdf"
}
}
};
var response = await client.SendEmailAsync(request);
Console.WriteLine($"Successfully queued. Message Id: {response.MessageId}");
}
}
For local development, wrap the SendSculptClient initialization with the proper port URL:
new SendSculptClient("your-api-key", "https://api.sendsculpt.com/api/v1").