Soenneker.Communication.Sms.Util 4.0.1044

Prefix Reserved
dotnet add package Soenneker.Communication.Sms.Util --version 4.0.1044
                    
NuGet\Install-Package Soenneker.Communication.Sms.Util -Version 4.0.1044
                    
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="4.0.1044" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Communication.Sms.Util" Version="4.0.1044" />
                    
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 4.0.1044
                    
#r "nuget: Soenneker.Communication.Sms.Util, 4.0.1044"
                    
#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@4.0.1044
                    
#: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=4.0.1044
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Communication.Sms.Util&version=4.0.1044
                    
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 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

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
4.0.1044 0 9/5/2026
4.0.1043 30 9/4/2026
4.0.1042 46 9/4/2026
4.0.1041 36 9/4/2026
4.0.1040 38 9/4/2026
4.0.1039 39 9/3/2026
4.0.1038 38 9/1/2026
4.0.1037 48 8/31/2026
4.0.1036 42 8/31/2026
4.0.1035 74 8/31/2026
4.0.1034 79 8/31/2026
4.0.1033 81 8/30/2026
4.0.1032 76 8/30/2026
4.0.1031 82 8/30/2026
4.0.1030 82 8/30/2026
4.0.1029 74 8/30/2026
4.0.1027 87 8/29/2026
4.0.1026 82 8/26/2026
4.0.1025 87 8/25/2026
4.0.1024 95 8/22/2026
Loading failed

Update dependency Soenneker.Communication.Sms.Client to 4.0.1738 (#1587)