Monday, September 9, 2013

Send SMS from Windows Phone using code

Hello friends,

Earlier we have tried to call to a phone number using phone.

Now in this tutorial we will try to send SMS using windows phone app code.

So we just start with a new project.  We design phone screen with one textbox control which is use to enter phone number and one text box for SMS text. We place a button with name btnSMS and text SEND SMS. Please see below screen.

As similar to Phone call app we need to add Reference of  “Microsoft.Phone.Tasks”.

Now on the click on the button we need to write following code

SmsComposeTask smstask = new SmsComposeTask();

smstask.To = txtPhone.Text;

smstask.Body = txtbody.Text ;

smstask.Show();

Now when you run you will get following screen.

You can download the code at https://skydrive.live.com/?cid=1eda2012469ff8ad&id=1EDA2012469FF8AD!243

Enjoy doing SMS

Thanks & Best Regards,

Rajat Jaiswal

No comments:

Post a Comment