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

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();
}
}
}

7 Comments

  • Is there a way to access sms inbox ?

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

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

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

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

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

  • Without interaction is currenting not possible to send email

Leave Your Comment