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 .
9 Comments
I want to send the SMS programatically, as I do it in Android. Lets see how long do we have to wait for this.
Thank You!!
its works!
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.
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.
hello, i try to send an sms in windows phone emulator, but it doesnt working…
can you help me??
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 …
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…
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.