Cloud Training (Online)




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 .

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

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 .