Windows Phone 8.1 and Windows Runtime Apps How to #11 – How to Send SMS in Windows Phone 8.1 XAML App ?

In the Windows Phone 8.0 and earlier version , the developers could utilize the SMSComposeTask to send SMS from the Windows Phone App. If you are targeting the Windows Phone 8.1 Silverlight model , this will still work fine . How about sending SMS from Windows Runtime App ?

How to Send SMS in Windows Phone 8.1 XAML(Windows Runtime) App ?

If you are targeting the Windows Phone 8.1 XAML App(Windows Runtime App) , you can use the ChatMessage class defined in the Windows.ApplicationModel.Chat namespace.

Below is a sample code snippet demonstrating how to send SMS from a Windows Phone 8.1 App.

async private void Button_Click(object sender, RoutedEventArgs e)
{
    ChatMessage chat = new ChatMessage();
    chat.Body = "Subject : This is a Test SMS from developerpublish.com";
    chat.Recipients.Add("000000");
    await Windows.ApplicationModel.Chat.ChatMessageManager.ShowComposeSmsMessageAsync(chat);
}

image

Leave A Reply

Your email address will not be published. Required fields are marked *

You May Also Like

In this post, you will learn about sync provider notifications in Windows 11 and how to disable or enable it...
In this tutorial, let’s learn how to enable or disable the startup sound in Windows 11. By default, when Windows...
The CameraCaptureTask allows the Windows Phone 7 App to launch the Camera Application . This will be useful when the...