Soenneker.Communication.Sms.Util 11.0.1126

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Soenneker.Communication.Sms.Util --version 11.0.1126
                    
NuGet\Install-Package Soenneker.Communication.Sms.Util -Version 11.0.1126
                    
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.Util" Version="11.0.1126" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Communication.Sms.Util" Version="11.0.1126" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Communication.Sms.Util" />
                    
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.Util --version 11.0.1126
                    
#r "nuget: Soenneker.Communication.Sms.Util, 11.0.1126"
                    
#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.Util@11.0.1126
                    
#: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.Util&version=11.0.1126
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Communication.Sms.Util&version=11.0.1126
                    
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.Util

Sends SMS messages through Azure Communication Services using a reusable SDK client.

Installation

dotnet add package Soenneker.Communication.Sms.Util

Configuration

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

Keep the connection string in a secret provider rather than source control.

Registration

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

services.AddAzureSmsUtilAsSingleton();

AddAzureSmsUtilAsScoped() is also available. Both registrations reuse the underlying Azure SMS client.

Usage

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

public sealed class VerificationMessages
{
    private readonly IAzureSmsUtil _sms;

    public VerificationMessages(IAzureSmsUtil sms)
    {
        _sms = sms;
    }

    public ValueTask<SmsSendResult> SendCode(
        string destination,
        string code,
        CancellationToken cancellationToken)
    {
        return _sms.SendWithResult(
            "+15551234567",
            destination,
            $"Your verification code is {code}",
            cancellationToken);
    }
}

The sender number must belong to the configured Azure Communication Services resource. Format sender and recipient phone numbers in E.164 form where required.

Use the existing Send(from, to, message) method when the immediate result and cancellation are not needed. It throws if Azure returns an unsuccessful per-message result.

Result and delivery behavior

  • SendWithResult returns Azure's immediate SmsSendResult, including unsuccessful results, the message ID, HTTP status, and error message. Check Successful before treating the request as accepted.
  • A successful send result means Azure accepted the request; it does not guarantee carrier or handset delivery.
  • Delivery reporting is enabled on every send. Process Azure Communication Services delivery-report events separately when final delivery status matters.
  • Azure request failures are thrown as RequestFailedException. The compatibility Send method surfaces a non-successful result as InvalidOperationException instead of silently completing.
  • Pass application cancellation through SendWithResult; the compatibility Send method has no cancellation parameter.
  • The utility logs the Azure message ID and success flag at debug level. It does not log the recipient or message body.
  • Treat phone numbers and message content as sensitive data and apply appropriate consent, retention, and redaction policies.
Product Compatible and additional computed target framework versions.
.NET net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
11.0.1128 0 12/2/2026
11.0.1127 47 12/1/2026
11.0.1126 52 12/1/2026
11.0.1125 52 12/1/2026
11.0.1124 72 11/30/2026
11.0.1123 87 11/29/2026
11.0.1122 93 11/29/2026
11.0.1121 94 11/29/2026
11.0.1120 102 11/18/2026
11.0.1119 107 11/18/2026
11.0.1118 102 11/11/2026
11.0.1117 96 11/11/2026
11.0.1115 96 11/11/2026
11.0.1114 94 11/11/2026
11.0.1113 91 11/11/2026
11.0.1112 96 11/11/2026
11.0.1111 108 11/3/2026
11.0.1110 113 10/27/2026
11.0.1109 109 10/27/2026
11.0.1108 104 10/26/2026
Loading failed

Updated Soenneker.Communication.Sms.Client to 11.0.1820