Skip to main content
The official .NET / C# client for sending emails via the SendSculpt Mailer API.
Requires .NET Standard 2.0+ / .NET 6+ and System.Text.Json

Installation

Install using NuGet:
dotnet add package SendSculpt.Sdk

Quick Start

Initialize the client with your API Key.
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.
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").