How to send SMS in Windows Phone 7 using C# ?

The developers can make use of the SMSComposeTask launcher to send the SMS in Windows Phone 7 .

To send the SMS in Windows Phone 7 using SMSComposeTask by including the namespace Microsoft.Phone.Tasks

using Microsoft.Phone.Tasks;

The Microsoft.Phone.Tasks namespace includes the classes necessary for all the Launcher and Chooser tasks .

Now , create the instance of the SMSComposerTask and set its “To” field to a valid number and the “Body” property to a text to be sent .

private void button1_Click(object sender, RoutedEventArgs e)
{
     SmsComposeTask composeSMS = new SmsComposeTask();
     composeSMS.Body = " This is a Test SMS sent using SmsComposeTask launcher";
     composeSMS.To = "1765432548";
     composeSMS.Show();
}

The Show method will display the SMSComposer screen which requires the user interaction to send the SMS .


Currently , the Windows Phone 7 does not supports directly sending the sms without the SMS Compose Screen .We may have to wait and watch to see if it will be available later .

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.

8 Comments

  1. Tushar May 25, 2011 Reply
  2. SifriG August 1, 2011 Reply
  3. Le@rner August 1, 2011 Reply
  4. How to send SMS in Windows Phone 7 using C# August 1, 2011 Reply
  5. Peter September 23, 2011 Reply
  6. jonathan ditya January 14, 2012 Reply
    • Senthil Kumar January 14, 2012 Reply
  7. jonathan ditya January 18, 2012 Reply
  8. deepanshu August 19, 2013 Reply

Leave a Reply


x

Interesting BlogPosts to read

How to get an Enumerator from range of elements from ArrayList in C# ?
The code snippet shown in this blog post demonstrates how you can get the enumeraor from a range of ...
How to check for the column name in an SqlDataReader Object in C# ?
When working in ADO.NET for data access , there are times when you want to check to see if a column ...
NEW EPSON FORCE SENSORS FOR ROBOTS ENABLE AUTOMATION OF DIFFICULT TASKS
Epson, a world leader in digital imaging and printing solutions, today announced the launch of its h...