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

This blog post will guide you through several effective methods to troubleshoot and resolve the issue of Microsoft Edge not...
Windows 11 offers a range of audio enhancements that can enrich your listening experience. These enhancements include features like virtual...
Windows 11 brings a fresh and visually stunning design to your desktop, and one of the standout features is the...