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
<PackageReference Include="Soenneker.Communication.Sms.Util" Version="4.0.1044" />
<PackageVersion Include="Soenneker.Communication.Sms.Util" Version="4.0.1044" />
<PackageReference Include="Soenneker.Communication.Sms.Util" />
paket add Soenneker.Communication.Sms.Util --version 4.0.1044
#r "nuget: Soenneker.Communication.Sms.Util, 4.0.1044"
#:package Soenneker.Communication.Sms.Util@4.0.1044
#addin nuget:?package=Soenneker.Communication.Sms.Util&version=4.0.1044
#tool nuget:?package=Soenneker.Communication.Sms.Util&version=4.0.1044
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
SendWithResultreturns Azure's immediateSmsSendResult, including unsuccessful results, the message ID, HTTP status, and error message. CheckSuccessfulbefore 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 compatibilitySendmethod surfaces a non-successful result asInvalidOperationExceptioninstead of silently completing. - Pass application cancellation through
SendWithResult; the compatibilitySendmethod 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 | Versions 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. |
-
net10.0
- Soenneker.Communication.Sms.Client (>= 4.0.1738)
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 |
Update dependency Soenneker.Communication.Sms.Client to 4.0.1738 (#1587)