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’ll learn about the Win32 Error “0x000019E5 – ERROR_COULD_NOT_RESIZE_LOG” that you get when debugging system erors in...
In this post, you’ll learn about the error “CO_E_DBERROR 0x8004E02B” that is returned when working with COM based APIs or...
In this post, you’ll learn about the Win32 Error “0x000019D0 – ERROR_LOG_BLOCK_VERSION” that you get when debugging system erors in...