How to send SMS in Windows Phone 8 Programatically using C#?

Published on October 29, 2013 by abundantcode

Filed under Windows Phone

Last modified October 29, 2013

Print this page

rate 1 star rate 2 star rate 3 star rate 4 star rate 5 star
Your rating: none, Average: 0 (0 votes)

This article have been viewed 6543 times

In Windows Phone, the developers can send SMS from their Windows Phone 8 Programatically using the launchers. The Windows Phone SDK provides the SMSComposeTask launcher which can be used to send SMS in Windows Phone 8.

Below is a code snippet demonstrating the usage of the SMSComposeTask to send SMS in Windows Phone 8.

How to send SMS in Windows Phone 8 Programatically using C#?

using Microsoft.Phone.Controls;
using Microsoft.Phone.Tasks;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using Windows.Phone.Speech.Recognition;
using Windows.System;
namespace AbundantCodeWP8
{
public partial class MainPage : PhoneApplicationPage
{
public MainPage()
{
   InitializeComponent();
}
private void Button_Click_1(object sender, RoutedEventArgs e)
{
   SmsComposeTask SMSCompose = new SmsComposeTask();
   SMSCompose.To = "<Number to which the SMS needs to be sent";
   SMSCompose.Body = "Message that needs to be sent";
   SMSCompose.Show();
}
}
}
If you enjoyed this post, please consider leaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.

7 Comments

  1. Is there a way to access sms inbox ?

    December 7, 2013 - 1:49 pm – Reply

    • AbundantCode

      No , the Windows Phone 8 SDK does not have the API does not allow the access at this moment

      December 8, 2013 - 9:55 am – Reply

  2. sarosh

    Will the SMS sent programatically appear in the Sent Messages of the phone??

    January 21, 2014 - 7:10 pm – Reply

    • AbundantCode

      This will appear in the Messaging App of your Windows Phone device.

      January 21, 2014 - 10:32 pm – Reply

  3. Anand

    Will the message be sent or we will have to confirm?? ( ie, should we press send?? )

    March 9, 2014 - 2:50 pm – Reply

  4. Lahiru

    Cant we send SMS without user interaction (without poping SMS app)?

    March 10, 2014 - 5:53 am – Reply

  5. AbundantCode

    Without interaction is currenting not possible to send email

    July 31, 2014 - 10:39 pm – Reply

Leave a Comment


x

You might be Interested in these Posts

C# and Lambda - Finding all the elements of an integer array less than 35

Here's a sample code snippet demonstrating how to find all the elements of an integer array that is ...

C# and LINQ - Finding all the elements of an integer array less than 35

Here's a sample code snippet demonstrating how to find all the elements of an integer array that is ...

How to get the CommandLine of the Current Application in C# ?

You might need to get the information that contains the commandline which is used to execute the cur...