Soenneker.Communication.Sms.Client 4.0.1760

Prefix Reserved
dotnet add package Soenneker.Communication.Sms.Client --version 4.0.1760
                    
NuGet\Install-Package Soenneker.Communication.Sms.Client -Version 4.0.1760
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Soenneker.Communication.Sms.Client" Version="4.0.1760" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Communication.Sms.Client" Version="4.0.1760" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Communication.Sms.Client" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Soenneker.Communication.Sms.Client --version 4.0.1760
                    
#r "nuget: Soenneker.Communication.Sms.Client, 4.0.1760"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Soenneker.Communication.Sms.Client@4.0.1760
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Soenneker.Communication.Sms.Client&version=4.0.1760
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Communication.Sms.Client&version=4.0.1760
                    
Install as a Cake Tool

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

Soenneker.Communication.Sms.Client

Provides a lazily created, reusable Azure Communication Services SmsClient through dependency injection.

Installation

dotnet add package Soenneker.Communication.Sms.Client

Configuration

{
  "Azure": {
    "CommunicationServices": {
      "ConnectionString": "<Azure Communication Services connection string>"
    }
  }
}

Store the connection string in a secret provider rather than source control or a checked-in settings file.

Registration

using Microsoft.Extensions.DependencyInjection;
using Soenneker.Communication.Sms.Client.Registrars;

services.AddSmsClientUtilAsSingleton();

AddSmsClientUtilAsScoped() creates one utility and Azure client per dependency-injection scope.

Usage

using Azure;
using Azure.Communication.Sms;
using Soenneker.Communication.Sms.Client.Abstract;

public sealed class SmsSender
{
    private readonly ISmsClientUtil _smsClients;

    public SmsSender(ISmsClientUtil smsClients)
    {
        _smsClients = smsClients;
    }

    public async ValueTask<SmsSendResult> Send(
        string from,
        string to,
        string message,
        CancellationToken cancellationToken)
    {
        SmsClient client = await _smsClients.Get(cancellationToken);

        Response<SmsSendResult> response = await client.SendAsync(
            from,
            to,
            message,
            cancellationToken: cancellationToken);

        return response.Value;
    }
}

The from number must belong to the authenticated Azure Communication Services resource. Use E.164 phone-number formatting where required by Azure and the destination country.

Inspect SmsSendResult.Successful, ErrorMessage, and related result fields; an accepted HTTP request does not make downstream carrier delivery instantaneous or guaranteed.

Lifecycle and behavior

  • The first Get creates the Azure client from Azure:CommunicationServices:ConnectionString; later calls return the same client.
  • The token passed to Get applies to lazy initialization. Pass a token to every SmsClient operation as well.
  • Azure SDK clients are designed for reuse. Let dependency injection dispose ISmsClientUtil; do not construct a new client per message.
  • Azure service failures are thrown as RequestFailedException.
  • This package exposes the Azure SDK client directly. Use Soenneker.Communication.Sms.Util for the repository's higher-level SMS sending abstraction.
  • Avoid logging message bodies, recipient numbers, connection strings, or other communication data unless the application has an explicit redaction and retention policy.
Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Soenneker.Communication.Sms.Client:

Package Downloads
Soenneker.Communication.Sms.Util

A utility library for Azure Communication Services SMS operations

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.0.1760 0 9/16/2026
4.0.1759 0 9/16/2026
4.0.1758 29 9/15/2026
4.0.1757 29 9/15/2026
4.0.1756 68 9/13/2026
4.0.1755 61 9/13/2026
4.0.1754 61 9/13/2026
4.0.1753 58 9/13/2026
4.0.1752 62 9/12/2026
4.0.1751 49 9/12/2026
4.0.1750 65 9/12/2026
4.0.1749 50 9/12/2026
4.0.1748 61 9/12/2026
4.0.1747 121 9/9/2026
4.0.1746 100 9/9/2026
4.0.1745 102 9/8/2026
4.0.1744 117 9/8/2026
4.0.1743 111 9/8/2026
4.0.1742 110 9/7/2026
4.0.1741 109 9/7/2026
Loading failed

Update dependency Soenneker.Extensions.Configuration to 4.0.895 (#2326)