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";

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.
Pin It

10 thoughts on “How to send SMS in Windows Phone 7 using C# ?

  1. hi all,

    i want to send sms from windows phone 7?

    i am check the SmsComposeTask for this but its just show the message compose window with assigned value of number and msg body.

    i want to send the sms directly from app without the user initiating.

    i read this may be possible by Push Notification so please help me for this.

    thanks in advance.

  2. Pingback: How to send SMS in Windows Phone 7 using C#

  3. Sending SMS without user interaction is not allowed.
    Vicious people could then write an app that sends charging SMS’s in the background without the user knowing about it.

    • In emulator , you can only go upto the compose SMS , then when you click send , you will not be able to do because it does not have cellular connection . try this on the Windows Device it will work …

  4. thanks for you answer Mr. senthil kumar..
    i have been connected my laptop to GSM modem, have write a code for connected port and database.. but really doesnt work… i
    can you help me to solve this problem..
    iam sorrr, im newbie… thanks before…

  5. what if the user press the hardware button without sending the message. I need to know if there is anything that confirm that the message is send from the phone. Or how to intimate the user that sending message is required.

  6. Pingback: How to send SMS in Windows Phone 7 using C# ?MobileOSGeek

Leave a Reply

Your email address will not be published. Required fields are marked *