Mobile that can send and receive sms nghĩa là gì năm 2024

sms doesn't work. I have a side problem now I'm trying to login to the public mobile app. but EVERSAFE asks to verify with SMS to login now.

Show

my thought process was to order a SIM card and do some troubleshooting with physical SIM with another phone rather than the ESIM.

Dựa trên thông tin từ kết quả tìm kiếm và sự hiểu biết, để tìm một điện thoại di động có thể gửi và nhận tin nhắn SMS, bạn cần thực hiện các bước sau:

  1. Đảm bảo rằng điện thoại di động bạn chọn hỗ trợ tính năng gửi và nhận tin nhắn SMS.
  2. Liên hệ với nhà mạng của bạn để xác nhận rằng bạn có thể gửi và nhận tin nhắn SMS trên mạng của họ.
  3. Đợi khoảng 24 giờ sau khi thử gửi tin nhắn để mạng có thể cập nhật và kích hoạt dịch vụ cho điện thoại của bạn.

Định Nghĩa: Mobile That Can Send and Receive SMS

Thuật ngữ "mobile that can send and receive SMS" (di động có khả năng gửi và nhận tin nhắn SMS) đề cập đến bất kỳ thiết bị di động nào có khả năng thực hiện gửi và nhận tin nhắn văn bản thông qua mạng di động. SMS, viết tắt của Short Message Service, là một dịch vụ cho phép người dùng gửi và nhận tin nhắn văn bản ngắn qua điện thoại di động.

Tính năng của điện thoại di động hỗ trợ SMS

  • Gửi tin nhắn văn bản: Người dùng có thể soạn và gửi tin nhắn đến số điện thoại khác.
  • Nhận tin nhắn văn bản: Thiết bị có khả năng nhận tin nhắn từ số điện thoại khác.
  • Lưu trữ tin nhắn: Có khả năng lưu trữ các tin nhắn văn bản để xem lại sau.
  • Tạo và quản lý danh sách liên lạc: Cho phép người dùng lưu số điện thoại và tên để dễ dàng gửi tin nhắn.

Lợi ích của SMS trong giao tiếp

  1. Tiện lợi và nhanh chóng: Gửi và nhận tin nhắn mọi lúc, mọi nơi.
  2. Dễ dàng sử dụng: Giao diện đơn giản, dễ hiểu cho mọi đối tượng người dùng.
  3. Hiệu quả chi phí: So với các phương tiện giao tiếp khác, SMS thường có chi phí thấp.
  4. Rộng rãi và phổ biến: Hầu hết điện thoại di động đều hỗ trợ tính năng này.

Với sự phát triển của công nghệ, ngày càng có nhiều ứng dụng và dịch vụ nhắn tin mới xuất hiện, nhưng SMS vẫn giữ một vị trí quan trọng trong giao tiếp hàng ngày nhờ vào sự đơn giản, tiện lợi và khả năng tương thích rộng rãi.

Không nhận được tin nhắn SMS từ một liên hệ cụ thể

Với ứng dụng tin nhắn hiện đại, việc cài đặt MMS trở nên dễ dàng và thuận tiện. Khám phá thêm thông tin hấp dẫn qua video trên YouTube ngay thôi!

XEM THÊM:

  • SMS OTP Vietcombank Là Gì? Bảo Mật Giao Dịch Đỉnh Cao Cho Người Dùng
  • SMS Plus là gì? Khám phá dịch vụ tin nhắn đa năng cho thời đại mới

Không thể gửi hoặc nhận tin nhắn hình ảnh (MMS) trên thiết bị Samsung galaxy

Can not send or receive picture messages This video also answers some of the queries below: Can not send or receive picture ...

With the recent requirement for all providers that offer SMS messaging capability, you are getting that error due to either lack of an active SMS campaign linked to your Zoom Phone number or having no SMS Campaign/Brand.

I am sharing the information you need to re-enable your SMS functionality:

SMS/MMS 10DLC Compliance for Zoom Phone and Zoom Contact Center

Setting up Zoom SMS with 10DLC Compliance for conversational messaging

Zoom Phone SMS error: Message could not be sent

There is currently a delay in getting campaign approval results:

Zoom 10DLC campaign registration delay In the event you have created a brand and your campaign is in pending status, your SMS functionality will be restored. For details about 10DLC, kindly refer to the information from:

FAQ about 10-Digit Long Code compliance for Zoom Phone and Zoom Contact Center

If you wish to opt out of Zoom Phone SMS entirely: Opting-out of SMS/MMS sent from Zoom Phone

Have a good day.

If the suggestion helped answer your question or provide a solution to your issue, please select "Accept as solution".

Hãy nâng cấp lên Microsoft Edge để tận dụng các tính năng mới nhất, bản cập nhật bảo mật và hỗ trợ kỹ thuật.

Quickstart: Send an SMS message

  • Bài viết
  • 04/19/2023

Trong bài viết này

Important

SMS capabilities depend on the phone number you use and the country/region that you're operating within as determined by your Azure billing address. For more information, see Subscription eligibility.

Note

Please share your thoughts and feedback about Azure Communication Services with us by taking this short survey.

Get started with Azure Communication Services by using the Communication module in Azure CLI to send SMS messages.

Completing this quickstart incurs a small cost of a few USD cents or less in your Azure account.

Prerequisites

  • An Azure account with an active subscription. Create an account for free.
  • An active Communication Services resource and connection string. Create a Communication Services resource.
  • An SMS-enabled telephone number. Get a phone number.
  • The latest Azure CLI version for your operating system.

Prerequisite check

  • In a terminal or command window, run

    export AZURE_COMMUNICATION_CONNECTION_STRING="<yourConnectionString>"

    3 to check that Azure CLI is installed.

Setting up

Install the communication module

Run the following command in a terminal or command window to install the communication module.

az extension add --name communication

Sign in to Azure CLI

You'll need to sign in to Azure CLI. You can sign in running the

export AZURE_COMMUNICATION_CONNECTION_STRING="<yourConnectionString>"

4 command from the terminal and providing your credentials.

Make sure you're using the correct subscription

If you have multiple subscriptions in your account, make sure that you're using the correct one for this tutorial.

In a terminal or command windows, run the following command to check the current subscription.

az account show

If you need to change subscription, you can do that by running the following command.

az account set --subscription "<yourSubcriptionId>"

You need to replace

export AZURE_COMMUNICATION_CONNECTION_STRING="<yourConnectionString>"

5 with your actual subscription ID, which you can find in the Subscriptions section in Azure portal.

(Optional) Use Azure CLI sms operations without passing in a connection string

You can configure the

export AZURE_COMMUNICATION_CONNECTION_STRING="<yourConnectionString>"

6 environment variable to use Azure CLI sms operations without having to use

export AZURE_COMMUNICATION_CONNECTION_STRING="<yourConnectionString>"

7 to pass in the connection string. To configure an environment variable, open a console window and select your operating system from the below tabs. Replace

export AZURE_COMMUNICATION_CONNECTION_STRING="<yourConnectionString>"

8 with your actual connection string.

Open a console window and enter the following command:

setx AZURE_COMMUNICATION_CONNECTION_STRING "<yourConnectionString>"

After you add the environment variable, you may need to restart any running programs that will need to read the environment variable, including the console window. For example, if you're using Visual Studio as your editor, restart Visual Studio before running the example.

Edit your

export AZURE_COMMUNICATION_CONNECTION_STRING="<yourConnectionString>"

9, and add the environment variable:

export AZURE_COMMUNICATION_CONNECTION_STRING="<yourConnectionString>"

After you add the environment variable, run

export AZURE_COMMUNICATION_CONNECTION_STRING="<yourConnectionString>"

0 from your console window to make the changes effective. If you created the environment variable with your IDE open, you may need to close and reopen the editor, IDE, or shell in order to access the variable.

Edit your

export AZURE_COMMUNICATION_CONNECTION_STRING="<yourConnectionString>"

1, and add the environment variable:

export AZURE_COMMUNICATION_CONNECTION_STRING="<yourConnectionString>"

After you add the environment variable, run

export AZURE_COMMUNICATION_CONNECTION_STRING="<yourConnectionString>"

2 from your console window to make the changes effective. If you created the environment variable with your IDE open, you may need to close and reopen the editor, IDE, or shell in order to access the variable.

Operations

Send a 1:1 SMS message

To send an SMS message to a single recipient, call the

export AZURE_COMMUNICATION_CONNECTION_STRING="<yourConnectionString>"

3 method from the sms module with a single recipient phone number.

az communication sms send --sender "<fromPhoneNumber>" --recipient "<toPhoneNumber>" --message "Hello world via SMS for Azure CLI!" --connection-string "<yourConnectionString>"

Make these replacements in the code:

  • Replace

    export AZURE_COMMUNICATION_CONNECTION_STRING="<yourConnectionString>"

    4 with an SMS-enabled phone number that's associated with your Communication Services resource.
  • Replace

    export AZURE_COMMUNICATION_CONNECTION_STRING="<yourConnectionString>"

    5 with a phone number that you'd like to send a message to.
  • Replace

    export AZURE_COMMUNICATION_CONNECTION_STRING="<yourConnectionString>"

    8 with your connection string.

Warning

Provide phone numbers in E.164 international standard format, for example, +14255550123. The value for

export AZURE_COMMUNICATION_CONNECTION_STRING="<yourConnectionString>"

4 can also be a short code, for example, 23456 or an alphanumeric sender ID, for example, CONTOSO.

Send a 1:N SMS message

To send an SMS message to a list of recipients, call the

export AZURE_COMMUNICATION_CONNECTION_STRING="<yourConnectionString>"

3 method from the sms module with multiple recipient phone numbers.

az communication sms send --sender "<fromPhoneNumber>" --recipient "<toPhoneNumber1>" "<toPhoneNumber2>" "<toPhoneNumber3>" --message "Hello world via SMS for Azure CLI!" --connection-string "<yourConnectionString>"

Make these replacements in the code:

  • Replace

    export AZURE_COMMUNICATION_CONNECTION_STRING="<yourConnectionString>"

    4 with an SMS-enabled phone number that's associated with your Communication Services resource.
  • Replace

    az communication sms send --sender "<fromPhoneNumber>" --recipient "<toPhoneNumber>" --message "Hello world via SMS for Azure CLI!" --connection-string "<yourConnectionString>"

    0 with the N'th phone number that you'd like to send a message to.
  • Replace

    export AZURE_COMMUNICATION_CONNECTION_STRING="<yourConnectionString>"

    8 with your connection string.

Warning

Provide phone numbers in E.164 international standard format, for example, +14255550123. The value for

export AZURE_COMMUNICATION_CONNECTION_STRING="<yourConnectionString>"

4 can also be a short code, for example, 23456 or an alphanumeric sender ID, for example, CONTOSO.

Get started with Azure Communication Services by using the Communication Services C# SMS SDK to send SMS messages.

Completing this quickstart incurs a small cost of a few USD cents or less in your Azure account.

Note

Find the finalized code for this quickstart on GitHub.

Prerequisites

  • An Azure account with an active subscription. Create an account for free.
  • The latest version of .NET Core SDK for your operating system.
  • An active Communication Services resource and connection string. Create a Communication Services resource.
  • An SMS-enabled telephone number. Get a phone number.

Prerequisite check

  • In a terminal or command window, run the

    az communication sms send --sender "<fromPhoneNumber>" --recipient "<toPhoneNumber>" --message "Hello world via SMS for Azure CLI!" --connection-string "<yourConnectionString>"

    3 command to check that the .NET SDK is installed.
  • To view the phone numbers that are associated with your Communication Services resource, sign in to the Azure portal and locate your Communication Services resource. In the navigation pane on the left, select Phone numbers.

Set up the application environment

To set up an environment for sending messages, take the steps in the following sections.

Create a new C# application

  1. In a console window, such as cmd, PowerShell, or Bash, use the

    az communication sms send --sender "<fromPhoneNumber>" --recipient "<toPhoneNumber>" --message "Hello world via SMS for Azure CLI!" --connection-string "<yourConnectionString>"

    4 command to create a new console app with the name

    az communication sms send --sender "<fromPhoneNumber>" --recipient "<toPhoneNumber>" --message "Hello world via SMS for Azure CLI!" --connection-string "<yourConnectionString>"

    5. This command creates a simple "Hello World" C# project with a single source file, Program.cs.

    dotnet new console -o SmsQuickstart

  2. Change your directory to the newly created app folder and use the

    az communication sms send --sender "<fromPhoneNumber>" --recipient "<toPhoneNumber>" --message "Hello world via SMS for Azure CLI!" --connection-string "<yourConnectionString>"

    6 command to compile your application.

    cd SmsQuickstart dotnet build

Install the package

  1. While still in the application directory, install the Azure Communication Services SMS SDK for .NET package by using the following command.

    az account show

    0
  2. Add a

    az communication sms send --sender "<fromPhoneNumber>" --recipient "<toPhoneNumber>" --message "Hello world via SMS for Azure CLI!" --connection-string "<yourConnectionString>"

    7 directive to the top of Program.cs to include the

    az communication sms send --sender "<fromPhoneNumber>" --recipient "<toPhoneNumber>" --message "Hello world via SMS for Azure CLI!" --connection-string "<yourConnectionString>"

    8 namespace.

    az account show

    1

Object model

The following classes and interfaces handle some of the major features of the Azure Communication Services SMS SDK for C#.

Name Description SmsClient This class is needed for all SMS functionality. You instantiate it with your subscription information, and use it to send SMS messages. SmsSendOptions This class provides options for configuring delivery reporting. If enable_delivery_report is set to True, an event is emitted when delivery is successful. SmsSendResult This class contains the result from the SMS service.

Authenticate the client

Open Program.cs in a text editor and replace the body of the

az communication sms send --sender "<fromPhoneNumber>" --recipient "<toPhoneNumber>" --message "Hello world via SMS for Azure CLI!" --connection-string "<yourConnectionString>"

9 method with code to initialize an

az communication sms send --sender "<fromPhoneNumber>" --recipient "<toPhoneNumber1>" "<toPhoneNumber2>" "<toPhoneNumber3>" --message "Hello world via SMS for Azure CLI!" --connection-string "<yourConnectionString>"

0 with your connection string. The following code retrieves the connection string for the resource from an environment variable named

az communication sms send --sender "<fromPhoneNumber>" --recipient "<toPhoneNumber1>" "<toPhoneNumber2>" "<toPhoneNumber3>" --message "Hello world via SMS for Azure CLI!" --connection-string "<yourConnectionString>"

1. Learn how to .

az account show

2

Send a 1:1 SMS message

To send an SMS message to a single recipient, call the

az communication sms send --sender "<fromPhoneNumber>" --recipient "<toPhoneNumber1>" "<toPhoneNumber2>" "<toPhoneNumber3>" --message "Hello world via SMS for Azure CLI!" --connection-string "<yourConnectionString>"

2 or

az communication sms send --sender "<fromPhoneNumber>" --recipient "<toPhoneNumber1>" "<toPhoneNumber2>" "<toPhoneNumber3>" --message "Hello world via SMS for Azure CLI!" --connection-string "<yourConnectionString>"

3 function from the SmsClient. Add this code to the end of the

az communication sms send --sender "<fromPhoneNumber>" --recipient "<toPhoneNumber>" --message "Hello world via SMS for Azure CLI!" --connection-string "<yourConnectionString>"

9 method in Program.cs:

az account show

3

Make these replacements in the code:

  • Replace

    az communication sms send --sender "<fromPhoneNumber>" --recipient "<toPhoneNumber1>" "<toPhoneNumber2>" "<toPhoneNumber3>" --message "Hello world via SMS for Azure CLI!" --connection-string "<yourConnectionString>"

    5 with an SMS-enabled phone number that's associated with your Communication Services resource.
  • Replace

    az communication sms send --sender "<fromPhoneNumber>" --recipient "<toPhoneNumber1>" "<toPhoneNumber2>" "<toPhoneNumber3>" --message "Hello world via SMS for Azure CLI!" --connection-string "<yourConnectionString>"

    6 with the phone number that you'd like to send a message to.

Warning

Provide phone numbers in E.164 international standard format, for example, +14255550123. The value for

az communication sms send --sender "<fromPhoneNumber>" --recipient "<toPhoneNumber1>" "<toPhoneNumber2>" "<toPhoneNumber3>" --message "Hello world via SMS for Azure CLI!" --connection-string "<yourConnectionString>"

5 can also be a short code, for example, 23456 or an alphanumeric sender ID, for example, CONTOSO.

Send a 1:N SMS message with options

To send an SMS message to a list of recipients, call the

az communication sms send --sender "<fromPhoneNumber>" --recipient "<toPhoneNumber1>" "<toPhoneNumber2>" "<toPhoneNumber3>" --message "Hello world via SMS for Azure CLI!" --connection-string "<yourConnectionString>"

2 or

az communication sms send --sender "<fromPhoneNumber>" --recipient "<toPhoneNumber1>" "<toPhoneNumber2>" "<toPhoneNumber3>" --message "Hello world via SMS for Azure CLI!" --connection-string "<yourConnectionString>"

3 function from the SmsClient with a list of recipient phone numbers. You can also provide optional parameters to specify whether the delivery report should be enabled and to set custom tags.

az account show

4

Make these replacements in the code:

  • Replace

    az communication sms send --sender "<fromPhoneNumber>" --recipient "<toPhoneNumber1>" "<toPhoneNumber2>" "<toPhoneNumber3>" --message "Hello world via SMS for Azure CLI!" --connection-string "<yourConnectionString>"

    5 with an SMS-enabled phone number that's associated with your Communication Services resource.
  • Replace

    dotnet new console -o SmsQuickstart

    1 and

    dotnet new console -o SmsQuickstart

    2 with phone numbers that you'd like to send a message to.

Warning

Provide phone numbers in E.164 international standard format, for example, +14255550123. The value for

az communication sms send --sender "<fromPhoneNumber>" --recipient "<toPhoneNumber1>" "<toPhoneNumber2>" "<toPhoneNumber3>" --message "Hello world via SMS for Azure CLI!" --connection-string "<yourConnectionString>"

5 can also be a short code, for example, 23456 or an alphanumeric sender ID, for example, CONTOSO.

The

dotnet new console -o SmsQuickstart

4 parameter is an optional parameter that you can use to configure delivery reporting. This functionality is useful when you want to emit events when SMS messages are delivered. See the Handle SMS Events quickstart to configure delivery reporting for your SMS messages.

You can use the

dotnet new console -o SmsQuickstart

5 parameter to apply a tag to the delivery report.

Run the code

Run the application from your application directory with the

dotnet new console -o SmsQuickstart

6 command.

az account show

5

Sample code

You can download the sample app from GitHub.

Get started with Azure Communication Services by using the Communication Services JavaScript SMS SDK to send SMS messages.

Completing this quickstart incurs a small cost of a few USD cents or less in your Azure account.

Note

Find the finalized code for this quickstart on GitHub.

Prerequisites

  • An Azure account with an active subscription. Create an account for free.
  • Node.js Active LTS and Maintenance LTS versions (8.11.1 and 10.14.1 are recommended).
  • An active Communication Services resource and connection string. Create a Communication Services resource.
  • An SMS-enabled telephone number. Get a phone number.

Prerequisite check

  • In a terminal or command window, run

    dotnet new console -o SmsQuickstart

    7 to check that Node.js is installed.
  • To view the phone numbers that are associated with your Communication Services resource, sign in to the Azure portal and locate your Communication Services resource. In the navigation pane on the left, select Phone numbers.

Set up the application environment

To set up an environment for sending messages, take the steps in the following sections.

Create a new Node.js application

  1. Open your terminal or command window, and then run the following command to create a new directory for your app and navigate to it.

    az account show

    6
  2. Run the following command to create a package.json file with default settings.

    az account show

    7
  3. Use a text editor to create a file called send-sms.js in the project root directory.

In the following sections, you'll add all the source code for this quickstart to the send-sms.js file that you just created.

Install the package

Use the

dotnet new console -o SmsQuickstart

8 command to install the Azure Communication Services SMS SDK for JavaScript.

az account show

8

The

dotnet new console -o SmsQuickstart

9 option lists the library as a dependency in your package.json file.

Object model

The following classes and interfaces handle some of the major features of the Azure Communication Services SMS SDK for Node.js.

Name Description SmsClient This class is needed for all SMS functionality. You instantiate it with your subscription information, and use it to send SMS messages. SmsSendRequest This interface is the model for building the SMS request. You use it to configure the to and from phone numbers and the SMS content. SmsSendOptions This interface provides options for configuring delivery reporting. If

dotnet new console -o SmsQuickstart

4 is set to

cd SmsQuickstart
dotnet build

1, an event is emitted when delivery is successful. SmsSendResult This class contains the result from the SMS service.

Authenticate the client

To authenticate a client, you import the SmsClient from the SDK and instantiate it with your connection string. You can retrieve the connection string for the resource from an environment variable. For instance, the code in this section retrieves the connection string from the

az communication sms send --sender "<fromPhoneNumber>" --recipient "<toPhoneNumber1>" "<toPhoneNumber2>" "<toPhoneNumber3>" --message "Hello world via SMS for Azure CLI!" --connection-string "<yourConnectionString>"

1 environment variable. Learn how to .

To import the client and instantiate it:

  1. Create a file named send-sms.js.
  2. Add the following code to send-sms.js.

az account show

9

Send a 1:N SMS message

To send an SMS message to a list of recipients, call the

export AZURE_COMMUNICATION_CONNECTION_STRING="<yourConnectionString>"

3 function from the SmsClient with a list of recipient phone numbers. If you'd like to send a message to a single recipient, include only one number in the list. Add this code to the end of send-sms.js:

az account set --subscription "<yourSubcriptionId>"

0

Make these replacements in the code:

  • Replace

    az communication sms send --sender "<fromPhoneNumber>" --recipient "<toPhoneNumber1>" "<toPhoneNumber2>" "<toPhoneNumber3>" --message "Hello world via SMS for Azure CLI!" --connection-string "<yourConnectionString>"

    5 with an SMS-enabled phone number that's associated with your Communication Services resource.
  • Replace

    dotnet new console -o SmsQuickstart

    1 and

    dotnet new console -o SmsQuickstart

    2 with the phone numbers that you'd like to send a message to.

Warning

Provide phone numbers in E.164 international standard format, for example, +14255550123. The value for

az communication sms send --sender "<fromPhoneNumber>" --recipient "<toPhoneNumber1>" "<toPhoneNumber2>" "<toPhoneNumber3>" --message "Hello world via SMS for Azure CLI!" --connection-string "<yourConnectionString>"

5 can also be a short code, for example, 23456 or an alphanumeric sender ID, for example, CONTOSO.

Send a 1:N SMS message with options

You can also provide an options object to specify whether the delivery report should be enabled and to set custom tags.

az account set --subscription "<yourSubcriptionId>"

1

Make these replacements in the code:

  • Replace

    az communication sms send --sender "<fromPhoneNumber>" --recipient "<toPhoneNumber1>" "<toPhoneNumber2>" "<toPhoneNumber3>" --message "Hello world via SMS for Azure CLI!" --connection-string "<yourConnectionString>"

    5 with an SMS-enabled phone number that's associated with your Communication Services resource.
  • Replace

    dotnet new console -o SmsQuickstart

    1 and

    dotnet new console -o SmsQuickstart

    2 with phone numbers that you'd like to send a message to.

Warning

Provide phone numbers in E.164 international standard format, for example, +14255550123. The value for

az communication sms send --sender "<fromPhoneNumber>" --recipient "<toPhoneNumber1>" "<toPhoneNumber2>" "<toPhoneNumber3>" --message "Hello world via SMS for Azure CLI!" --connection-string "<yourConnectionString>"

5 can also be a short code, for example, 23456 or an alphanumeric sender ID, for example, CONTOSO.

The

dotnet new console -o SmsQuickstart

4 parameter is an optional parameter that you can use to configure delivery reporting. This functionality is useful when you want to emit events when SMS messages are delivered. See the Handle SMS Events quickstart to configure delivery reporting for your SMS messages. The

az account show

03 parameter is optional. You can use it to apply a tag to the delivery report.

Run the code

Use the

az account show

04 command to run the code that you added to the send-sms.js file.

az account set --subscription "<yourSubcriptionId>"

2

Get started with Azure Communication Services by using the Communication Services Python SMS SDK to send SMS messages.

Completing this quickstart incurs a small cost of a few USD cents or less in your Azure account.

Note

Find the finalized code for this quickstart on GitHub.

Prerequisites

  • An Azure account with an active subscription. Create an account for free.
  • Python 3.7+.
  • An active Communication Services resource and connection string. Create a Communication Services resource.
  • An SMS-enabled telephone number. Get a phone number.

Prerequisite check

  • In a terminal or command window, run the

    az account show

    05 command to check that Python is installed.
  • To view the phone numbers that are associated with your Communication Services resource, sign in to the Azure portal and locate your Communication Services resource. In the navigation pane on the left, select Phone numbers.

Set up the application environment

To set up an environment for sending messages, take the steps in the following sections.

Create a new Python application

  1. Open your terminal or command window. Then use the following command to create a new directory for your app and navigate to it.

    az account show

    6
  2. Use a text editor to create a file called send-sms.py in the project root directory and add the structure for the program, including basic exception handling.

    az account set --subscription "<yourSubcriptionId>"

    4

In the following sections, you'll add all the source code for this quickstart to the send-sms.py file that you just created.

Install the package

While still in the application directory, install the Azure Communication Services SMS SDK for Python package by using the following command.

az account set --subscription "<yourSubcriptionId>"

5

Object model

The following classes and interfaces handle some of the major features of the Azure Communication Services SMS SDK for Python.

Name Description SmsClient This class is needed for all SMS functionality. You instantiate it with your subscription information, and use it to send SMS messages. SmsSendResult This class contains the result from the SMS service.

Authenticate the client

Instantiate an SmsClient with your connection string. Learn how to .

az account set --subscription "<yourSubcriptionId>"

6

For simplicity, this quickstart uses connection strings, but in production environments, we recommend using service principals.

Send a 1:1 SMS message

To send an SMS message to a single recipient, call the

export AZURE_COMMUNICATION_CONNECTION_STRING="<yourConnectionString>"

3 method from the SmsClient with a single recipient phone number. You can also provide optional parameters to specify whether the delivery report should be enabled and to set custom tags. Add this code to the end of the

az account show

07 block in send-sms.py:

az account set --subscription "<yourSubcriptionId>"

7

Make these replacements in the code:

  • Replace

    az communication sms send --sender "<fromPhoneNumber>" --recipient "<toPhoneNumber1>" "<toPhoneNumber2>" "<toPhoneNumber3>" --message "Hello world via SMS for Azure CLI!" --connection-string "<yourConnectionString>"

    5 with an SMS-enabled phone number that's associated with your communication service.
  • Replace

    az communication sms send --sender "<fromPhoneNumber>" --recipient "<toPhoneNumber1>" "<toPhoneNumber2>" "<toPhoneNumber3>" --message "Hello world via SMS for Azure CLI!" --connection-string "<yourConnectionString>"

    6 with the phone number that you'd like to send a message to.

Warning

Provide phone numbers in E.164 international standard format, for example, +14255550123. The value for

az communication sms send --sender "<fromPhoneNumber>" --recipient "<toPhoneNumber1>" "<toPhoneNumber2>" "<toPhoneNumber3>" --message "Hello world via SMS for Azure CLI!" --connection-string "<yourConnectionString>"

5 can also be a short code, for example, 23456 or an alphanumeric sender ID, for example, CONTOSO.

Send a 1:N SMS message

To send an SMS message to a list of recipients, call the

export AZURE_COMMUNICATION_CONNECTION_STRING="<yourConnectionString>"

3 method from the SmsClient with a list of recipient phone numbers. You can also provide optional parameters to specify whether the delivery report should be enabled and to set custom tags. Add this code to the end of the

az account show

07 block in send-sms.py:

az account set --subscription "<yourSubcriptionId>"

8

Make these replacements in the code:

  • Replace

    az communication sms send --sender "<fromPhoneNumber>" --recipient "<toPhoneNumber1>" "<toPhoneNumber2>" "<toPhoneNumber3>" --message "Hello world via SMS for Azure CLI!" --connection-string "<yourConnectionString>"

    5 with an SMS-enabled phone number that's associated with your communication service.
  • Replace

    dotnet new console -o SmsQuickstart

    1 and

    dotnet new console -o SmsQuickstart

    2 with phone numbers that you'd like to send a message to.

Warning

Provide phone numbers in E.164 international standard format, for example, +14255550123. The value for

az communication sms send --sender "<fromPhoneNumber>" --recipient "<toPhoneNumber1>" "<toPhoneNumber2>" "<toPhoneNumber3>" --message "Hello world via SMS for Azure CLI!" --connection-string "<yourConnectionString>"

5 can also be a short code, for example, 23456 or an alphanumeric sender ID, for example, CONTOSO.

Optional parameters

The

az account show

17 parameter is an optional parameter that you can use to configure delivery reporting. This functionality is useful when you want to emit events when SMS messages are delivered. See the Handle SMS Events quickstart to configure delivery reporting for your SMS messages.

The

az account show

03 parameter is an optional parameter that you can use to apply a tag to the delivery report.

Run the code

Run the application from your application directory with the

az account show

19 command.

az account set --subscription "<yourSubcriptionId>"

9

The complete Python script should look something like the following code:

setx AZURE_COMMUNICATION_CONNECTION_STRING "<yourConnectionString>"

0

Get started with Azure Communication Services by using the Communication Services Java SMS SDK to send SMS messages.

Completing this quickstart incurs a small cost of a few USD cents or less in your Azure account.

Note

Find the finalized code for this quickstart on GitHub.

Prerequisites

  • An Azure account with an active subscription. Create an account for free.
  • Java Development Kit (JDK) version 8 or later.
  • Apache Maven.
  • An active Communication Services resource and connection string. Create a Communication Services resource.
  • An SMS-enabled telephone number. Get a phone number.

Prerequisite check

  • In a terminal or command window, run

    az account show

    20 to check that Maven is installed.
  • To view the phone numbers that are associated with your Communication Services resource, sign in to the Azure portal and locate your Communication Services resource. In the navigation pane on the left, select Phone numbers.

Set up the application environment

To set up an environment for sending messages, take the steps in the following sections.

Create a new Java application

Open your terminal or command window and navigate to the directory where you would like to create your Java application. Run the following command to generate the Java project from the maven-archetype-quickstart template.

  • Command Prompt

setx AZURE_COMMUNICATION_CONNECTION_STRING "<yourConnectionString>"

1

  • PowerShell

setx AZURE_COMMUNICATION_CONNECTION_STRING "<yourConnectionString>"

2

The

az account show

21 goal creates a directory with the same name as the

az account show

22 value. Under this directory, the src/main/java directory contains the project source code, the src/test/java directory contains the test source, and the pom.xml file is the project's Project Object Model (POM).

Install the package

Open the pom.xml file in your text editor. Add the following dependency element to the group of dependencies.

setx AZURE_COMMUNICATION_CONNECTION_STRING "<yourConnectionString>"

3

Set up the app framework

Open /src/main/java/com/communication/quickstart/App.java in a text editor, add import directives, and remove the

az account show

23 statement:

setx AZURE_COMMUNICATION_CONNECTION_STRING "<yourConnectionString>"

4

Object model

The following classes and interfaces handle some of the major features of the Azure Communication Services SMS SDK for Java.

Name Description SmsClientBuilder This class creates the SmsClient. You provide it with an endpoint, a credential, and an HTTP client. SmsClient This class is needed for all SMS functionality. You use it to send SMS messages. SmsSendOptions This class provides options to add custom tags and configure delivery reporting. If deliveryReportEnabled is set to true, an event is emitted when delivery is successful. SmsSendResult This class contains the result from the SMS service.

Authenticate the client

To authenticate a client, you instantiate an

az communication sms send --sender "<fromPhoneNumber>" --recipient "<toPhoneNumber1>" "<toPhoneNumber2>" "<toPhoneNumber3>" --message "Hello world via SMS for Azure CLI!" --connection-string "<yourConnectionString>"

0 with your connection string. For the credential, use the

az account show

25 from the Azure portal. Learn how to . You can also initialize the client with any custom HTTP client that implements the

az account show

26 interface.

To instantiate a client, add the following code to the

az account show

27 method:

setx AZURE_COMMUNICATION_CONNECTION_STRING "<yourConnectionString>"

5

You can also provide the entire connection string by using the

az account show

28 function instead of providing the endpoint and access key.

setx AZURE_COMMUNICATION_CONNECTION_STRING "<yourConnectionString>"

6

Send a 1:1 SMS message

To send an SMS message to a single recipient, call the

export AZURE_COMMUNICATION_CONNECTION_STRING="<yourConnectionString>"

3 method from the SmsClient with a single recipient phone number. You can also provide optional parameters to specify whether the delivery report should be enabled and to set custom tags.

setx AZURE_COMMUNICATION_CONNECTION_STRING "<yourConnectionString>"

7

Make these replacements in the code:

  • Replace

    az communication sms send --sender "<fromPhoneNumber>" --recipient "<toPhoneNumber1>" "<toPhoneNumber2>" "<toPhoneNumber3>" --message "Hello world via SMS for Azure CLI!" --connection-string "<yourConnectionString>"

    5 with an SMS-enabled phone number that's associated with your Communication Services resource.
  • Replace

    az communication sms send --sender "<fromPhoneNumber>" --recipient "<toPhoneNumber1>" "<toPhoneNumber2>" "<toPhoneNumber3>" --message "Hello world via SMS for Azure CLI!" --connection-string "<yourConnectionString>"

    6 with a phone number that you'd like to send a message to.

Warning

Provide phone numbers in E.164 international standard format, for example, +14255550123. The value for

az communication sms send --sender "<fromPhoneNumber>" --recipient "<toPhoneNumber1>" "<toPhoneNumber2>" "<toPhoneNumber3>" --message "Hello world via SMS for Azure CLI!" --connection-string "<yourConnectionString>"

5 can also be a short code, for example, 23456 or an alphanumeric sender ID, for example, CONTOSO.

Send a 1:N SMS message with options

To send an SMS message to a list of recipients, call the

export AZURE_COMMUNICATION_CONNECTION_STRING="<yourConnectionString>"

3 method with a list of recipient phone numbers. You can also provide optional parameters to specify whether the delivery report should be enabled and to set custom tags.

setx AZURE_COMMUNICATION_CONNECTION_STRING "<yourConnectionString>"

8

Make these replacements in the code:

  • Replace

    az communication sms send --sender "<fromPhoneNumber>" --recipient "<toPhoneNumber1>" "<toPhoneNumber2>" "<toPhoneNumber3>" --message "Hello world via SMS for Azure CLI!" --connection-string "<yourConnectionString>"

    5 with an SMS-enabled phone number that's associated with your Communication Services resource
  • Replace

    dotnet new console -o SmsQuickstart

    1 and

    dotnet new console -o SmsQuickstart

    2 with phone numbers that you'd like to send a message to.

Warning

Provide phone numbers in E.164 international standard format, for example, +14255550123. The value for

az communication sms send --sender "<fromPhoneNumber>" --recipient "<toPhoneNumber1>" "<toPhoneNumber2>" "<toPhoneNumber3>" --message "Hello world via SMS for Azure CLI!" --connection-string "<yourConnectionString>"

5 can also be a short code, for example, 23456 or an alphanumeric sender ID, for example, CONTOSO.

The

az account show

38 method is used to configure delivery reporting. This functionality is useful when you want to emit events when SMS messages are delivered. See the Handle SMS Events quickstart to configure delivery reporting for your SMS messages.

You can use the

az account show

39 method to apply a tag to the delivery report.

Run the code

  1. Navigate to the directory that contains the pom.xml file and compile the project by using the

    az account show

    40 command.

    setx AZURE_COMMUNICATION_CONNECTION_STRING "<yourConnectionString>"

    9
  2. Build the package.

    export AZURE_COMMUNICATION_CONNECTION_STRING="<yourConnectionString>"

    0
  3. Run the following

    az account show

    40 command to execute the app.

    • Command Prompt

      export AZURE_COMMUNICATION_CONNECTION_STRING="<yourConnectionString>"

      1
    • PowerShell

      export AZURE_COMMUNICATION_CONNECTION_STRING="<yourConnectionString>"

      2

By using the Azure Communication Services SMS connector and Azure Logic Apps, you can create automated workflows that can send SMS messages. This quickstart shows how to automatically send text messages in response to a trigger event, which is the first step in a logic app workflow. A trigger event can be an incoming email message, a recurrence schedule, an Azure Event Grid resource event, or any other trigger that's supported by Azure Logic Apps.

Mobile that can send and receive sms nghĩa là gì năm 2024

Although this quickstart focuses on using the connector to respond to a trigger, you can also use the connector to respond to other actions, which are the steps that follow the trigger in a workflow. If you're new to Logic Apps, review What is Azure Logic Apps before you get started.

Note

Completing this quickstart incurs a small cost of a few USD cents or less in your Azure account.

Prerequisites

  • An Azure account with an active subscription, or create an Azure account for free.
  • An active Azure Communication Services resource, or create a Communication Services resource.
  • An active Logic Apps resource (logic app), or create a blank logic app but with the trigger that you want to use. Currently, the Azure Communication Services SMS connector provides only actions, so your logic app requires a trigger, at minimum. This quickstart uses the When a new email arrives trigger, which is available with the Office 365 Outlook connector.
  • An SMS enabled phone number, or get a phone number.

Important

SMS and PSTN capabilities depend on the phone number you use and the country/region that you're operating within as determined by your Azure billing address. For more information, visit the Subscription eligibility documentation.

Add an SMS action

To add the Send SMS action as a new step in your workflow by using the Azure Communication Services SMS connector, follow these steps in the Azure portal with your logic app workflow open in the Logic App Designer:

  1. On the designer, under the step where you want to add the new action, select New step. Alternatively, to add the new action between steps, move your pointer over the arrow between those steps, select the plus sign (+), and select Add an action.
  2. In the Choose an operation search box, enter

    az account show

    42. From the actions list, select Send SMS.
    Mobile that can send and receive sms nghĩa là gì năm 2024
  3. Now create a connection to your Communication Services resource.
    1. Within the same subscription:
      1. Provide a name for the connection.
      2. Select your Azure Communication Services resource.
      3. Select Create.
        Mobile that can send and receive sms nghĩa là gì năm 2024
    2. Using the connection string from your Communication Services resource:
      1. Provide a name for the connection.
      2. Select ConnectionString Authentication from the drop down options.
      3. Enter the connection string of your Communication Services resource.
      4. Select Create.
        Mobile that can send and receive sms nghĩa là gì năm 2024
    3. Using Service Principal (Refer Services Principal Creation):
      1. Provide a name for the connection.
      2. Select Service principal (Microsoft Entra application) Authentication from the drop down options.
      3. Enter the Tenant ID, Client ID & Client Secret of your Service Principal.
      4. Enter the Communication Services Endpoint URL value of your Communication Services resource.
      5. Select Create.
        Mobile that can send and receive sms nghĩa là gì năm 2024
  4. In the Send SMS action, provide the following information:
    • The source and destination phone numbers. For testing purposes, you can use your own phone number as the destination phone number.
    • The message content that you want to send, for example, "Hello from Logic Apps!". Here's a Send SMS action with example information:
      Mobile that can send and receive sms nghĩa là gì năm 2024
  5. When you're done, on the designer toolbar, select Save.

Next, run your workflow for testing.

Test your workflow

To manually start your workflow, on the designer toolbar, select Run. Or, you can wait for the trigger to fire. In both cases, the workflow should send an SMS message to your specified destination phone number. For more information, review .

Clean up workflow resources

To clean up your logic app workflow and related resources, review .

Troubleshooting

To troubleshoot issues related to SMS delivery, you can enable delivery reporting with Event Grid to capture delivery details.

Clean up resources

If you want to clean up and remove a Communication Services subscription, you can delete the resource or resource group. Deleting the resource group also deletes any other resources associated with it. Learn more about .

Toll-free verification

If you have a new toll-free number and want to send a or send SMS messages to Canadian phone numbers, see to learn how to verify your toll-free number.