Soenneker.Communication.Sms.Client 4.0.1738

Prefix Reserved
dotnet add package Soenneker.Communication.Sms.Client --version 4.0.1738
                    
NuGet\Install-Package Soenneker.Communication.Sms.Client -Version 4.0.1738
                    
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.1738" />
                    
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.1738" />
                    
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.1738
                    
#r "nuget: Soenneker.Communication.Sms.Client, 4.0.1738"
                    
#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.1738
                    
#: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.1738
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Communication.Sms.Client&version=4.0.1738
                    
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.1738 0 9/5/2026
4.0.1737 36 9/4/2026
4.0.1736 38 9/4/2026
4.0.1735 44 9/4/2026
4.0.1733 48 9/4/2026
4.0.1732 42 9/3/2026
4.0.1731 109 8/31/2026
4.0.1730 87 8/31/2026
4.0.1729 79 8/31/2026
4.0.1728 88 8/31/2026
4.0.1727 93 8/31/2026
4.0.1726 93 8/31/2026
4.0.1725 94 8/30/2026
4.0.1724 83 8/30/2026
4.0.1723 93 8/30/2026
4.0.1722 95 8/30/2026
4.0.1721 85 8/30/2026
4.0.1720 83 8/30/2026
4.0.1719 107 8/29/2026
4.0.1718 83 8/29/2026
Loading failed

Update dependency Soenneker.Extensions.Configuration to 4.0.875 (#2288)