Soenneker.Communication.Sms.Util 11.0.1111

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.1111
                    
NuGet\Install-Package Soenneker.Communication.Sms.Util -Version 11.0.1111
                    
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.1111" />
                    
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.1111" />
                    
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.1111
                    
#r "nuget: Soenneker.Communication.Sms.Util, 11.0.1111"
                    
#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.1111
                    
#: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.1111
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Communication.Sms.Util&version=11.0.1111
                    
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.1120 49 11/18/2026
11.0.1119 57 11/18/2026
11.0.1118 98 11/11/2026
11.0.1117 92 11/11/2026
11.0.1115 92 11/11/2026
11.0.1114 90 11/11/2026
11.0.1113 85 11/11/2026
11.0.1112 90 11/11/2026
11.0.1111 103 11/3/2026
11.0.1110 110 10/27/2026
11.0.1109 105 10/27/2026
11.0.1108 99 10/26/2026
11.0.1107 97 10/26/2026
11.0.1106 86 10/26/2026
11.0.1105 101 10/26/2026
11.0.1104 96 10/26/2026
11.0.1103 109 10/26/2026
4.0.1102 105 10/26/2026
4.0.1101 111 10/15/2026
4.0.1100 103 10/15/2026
Loading failed

Updated Multiple NuGet packages