![]() |
VOOZH | about |
dotnet add package Azure.Communication.Sms --version 1.0.2
NuGet\Install-Package Azure.Communication.Sms -Version 1.0.2
<PackageReference Include="Azure.Communication.Sms" Version="1.0.2" />
<PackageVersion Include="Azure.Communication.Sms" Version="1.0.2" />Directory.Packages.props
<PackageReference Include="Azure.Communication.Sms" />Project file
paket add Azure.Communication.Sms --version 1.0.2
#r "nuget: Azure.Communication.Sms, 1.0.2"
#:package Azure.Communication.Sms@1.0.2
#addin nuget:?package=Azure.Communication.Sms&version=1.0.2Install as a Cake Addin
#tool nuget:?package=Azure.Communication.Sms&version=1.0.2Install as a Cake Tool
This package contains a C# SDK for Azure Communication Services for SMS and Telephony.
Source code | Package (NuGet) | Product documentation
Install the Azure Communication SMS client library for .NET with NuGet:
dotnet add package Azure.Communication.Sms
You need an Azure subscription and a Communication Service Resource to use this package.
To create a new Communication Service, you can use the Azure Portal, the Azure PowerShell, or the .NET management client library.
SmsClient provides the functionality to send messages between phone numbers.
using System;
using System.IO;
using Azure.Communication.Sms;
SMS clients can be authenticated using the connection string acquired from an Azure Communication Resource in the Azure Portal.
var connectionString = "<connection_string>"; // Find your Communication Services resource in the Azure portal
SmsClient client = new SmsClient(connectionString);
Alternatively, SMS clients can also be authenticated using a valid token credential. With this option,
AZURE_CLIENT_SECRET, AZURE_CLIENT_ID and AZURE_TENANT_ID environment variables need to be set up for authentication.
string endpoint = "<endpoint_url>";
TokenCredential tokenCredential = new DefaultAzureCredential();
SmsClient client = new SmsClient(new Uri(endpoint), tokenCredential);
To send a SMS message, call the Send or SendAsync function from the SmsClient.
SmsSendResult sendResult = await smsClient.SendAsync(
from: "<from-phone-number>", // Your E.164 formatted from phone number used to send SMS
to: "<to-phone-number>", // E.164 formatted recipient phone number
message: "Hi");
Console.WriteLine($"Sms id: {sendResult.MessageId}");
To send a SMS message to a list of recipients, call the Send or SendAsync function from the SmsClient with a list of recipient's phone numbers.
You may also add pass in an options object to specify whether the delivery report should be enabled and set custom tags.
var response = await smsClient.SendAsync(
from: "<from-phone-number>", // Your E.164 formatted from phone number used to send SMS
to: new string[] { "<to-phone-number-1>", "<to-phone-number-2>" }, // E.164 formatted recipient phone numbers
message: "Weekly Promotion!",
options: new SmsSendOptions(enableDeliveryReport: true) // OPTIONAL
{
Tag = "marketing", // custom tags
});
foreach (SmsSendResult result in response.Value)
{
Console.WriteLine($"Sms id: {result.MessageId}");
Console.WriteLine($"Send Result Successful: {result.Successful}");
}
SMS operations will throw an exception if the request to the server fails.
Exceptions will not be thrown if the error is caused by an individual message, only if something fails with the overall request.
Please use the Successful flag to validate each individual result to verify if the message was sent.
try
{
var response = await smsClient.SendAsync(
from: "<from-phone-number>" // Your E.164 formatted phone number used to send SMS
to: new string [] {"<to-phone-number-1>", "<to-phone-number-2>"}, // E.164 formatted recipient phone number
message: "Weekly Promotion!",
options: new SmsSendOptions(enableDeliveryReport: true) // OPTIONAL
{
Tag = "marketing", // custom tags
});
foreach (SmsSendResult result in response.Value)
{
if (result.Successful)
{
Console.WriteLine($"Successfully sent this message: {result.MessageId} to {result.To}.");
}
else
{
Console.WriteLine($"Something went wrong when trying to send this message {result.MessageId} to {result.To}.");
Console.WriteLine($"Status code {result.HttpStatusCode} and error message {result.ErrorMessage}.");
}
}
}
catch (RequestFailedException ex)
{
Console.WriteLine(ex.Message);
}
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit cla.microsoft.com.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact with any additional questions or comments.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 was computed. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 netcoreapp2.0 was computed. netcoreapp2.1 netcoreapp2.1 was computed. netcoreapp2.2 netcoreapp2.2 was computed. netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 netstandard2.0 is compatible. netstandard2.1 netstandard2.1 was computed. |
| .NET Framework | net461 net461 was computed. net462 net462 was computed. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 was computed. net48 net48 was computed. net481 net481 was computed. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen40 tizen40 was computed. tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
Showing the top 5 NuGet packages that depend on Azure.Communication.Sms:
| Package | Downloads |
|---|---|
|
OrchardCore.Application.Cms.Core.Targets
Orchard Core CMS is a Web Content Management System (CMS) built on top of the Orchard Core Framework. Converts the application into a modular OrchardCore CMS application with TheAdmin theme but without any front-end Themes. |
|
|
OrchardCore.Application.Cms.Targets
Orchard Core CMS is a Web Content Management System (CMS) built on top of the Orchard Core Framework. Converts the application into a modular OrchardCore CMS application with following themes. - TheAdmin Theme - SafeMode Theme - TheAgency Theme - TheBlog Theme - TheComingSoon Theme - TheTheme theme |
|
|
Soenneker.Communication.Sms.Client
An async thread-safe singleton for the Azure Communication Services SMS client |
|
|
OrchardCore.Sms.Azure
Orchard Core CMS is a Web Content Management System (CMS) built on top of the Orchard Core Framework. The Azure Communication SMS feature enables sending SMS messages via Azure Communication Services (ACS). |
|
|
Bot.Builder.Community.Adapters.ACS.SMS
Adapter for v4 of the Bot Builder .NET SDK to allow for a bot to be used with SMS via Azure Communication Services. |
Showing the top 7 popular GitHub repositories that depend on Azure.Communication.Sms:
| Repository | Stars |
|---|---|
|
OrchardCMS/OrchardCore
Orchard Core is an open-source modular and multi-tenant application framework built with ASP.NET Core, and a content management system (CMS) built on top of that framework.
|
|
|
microsoft/mcp
Catalog of official Microsoft MCP (Model Context Protocol) server implementations for AI-powered data access and tool integration
|
|
|
phongnguyend/Practical.CleanArchitecture
Full-stack .Net 10 Clean Architecture (Microservices, Modular Monolith, Monolith), Blazor, Angular 21, React 19, Vue 3.5, BFF with YARP, NextJs 16, Domain-Driven Design, CQRS, SOLID, Asp.Net Core Identity Custom Storage, OpenID Connect, EF Core, OpenTelemetry, SignalR, Background Services, Health Checks, Rate Limiting, Clouds (Azure, AWS, GCP), ...
|
|
|
BotBuilderCommunity/botbuilder-community-dotnet
Part of the Bot Builder Community Project. Repository for extensions for the Bot Builder .NET SDK, including middleware, dialogs, recognizers and more.
|
|
|
Azure-Samples/communication-services-AI-customer-service-sample
A sample app for the customer support center running in Azure, using Azure Communication Services and Azure OpenAI for text and voice bots.
|
|
|
kamilbaczek/Modular-monolith-by-example
Modular monolith architecture example in .NET. Estimation Tool is tool to optimize estimation process in IT company.
|
|
|
Azure-Samples/communication-services-dotnet-quickstarts
Sample code for Azure Communication Services .Net quickstarts
|
| Version | Downloads | Last Updated |
|---|---|---|
| 1.1.0-beta.3 | 25,756 | 6/12/2025 |
| 1.1.0-beta.2 | 6,716 | 12/6/2024 |
| 1.1.0-beta.1 | 11,916 | 4/24/2024 |
| 1.0.2 | 802,142 | 9/18/2025 |
| 1.0.1 | 2,751,631 | 5/25/2021 |
| 1.0.0 | 55,499 | 3/29/2021 |
| 1.0.0-beta.4 | 3,185 | 3/10/2021 |
| 1.0.0-beta.3 | 38,244 | 11/16/2020 |
| 1.0.0-beta.2 | 136,101 | 10/6/2020 |
| 1.0.0-beta.1 | 11,701 | 9/22/2020 |