Reputation:
I need to know how to send a sms through a windows phone 8. It is not just a button click sms. I need some sms to send when I calculate some time and when my timer reach to some specific time the sms to be automatically delivered to the specific number stated.
SmsComposeTask smsComposeTask = new SmsComposeTask();
smsComposeTask.To = "2065550123";
smsComposeTask.Body = "Try this new application. It's great!";
smsComposeTask.Show();
this code works for button click and send message button click. I want this to happen automatically.
Upvotes: 0
Views: 1161
Reputation: 59763
You would need to use a 3rd party service that supports sending an SMS. You cannot create and send a SMS message from a Windows Phone application without the user's consent, for each message. The code you provided will start the Messaging application, but the user still has an opportunity to cancel or edit the message before they press the Send button.
Further, if the application is not running, you may find that the timeliness of a message like you suggest may not be ideal (as applications cannot run constantly in the background).
Upvotes: 2