tags:

views:

153

answers:

3

Possible Duplicate:
How to programmatically send SMS on the iPhone?

I want to send sms programmatically. I tried with the following code,It triggers message composer and then user needs to manually select the send button but I just want everything to be done programmatically that is even to send sms not only insert recipent number and body message.

MFMessageComposeViewController *controller = [[[MFMessageComposeViewController alloc] init] autorelease];
 controller.body = @"Hello from Dinesh";
 controller.recipients = [NSArray arrayWithObjects:@"999468*****", @"91999468****", nil];
 controller.messageComposeDelegate = self;
 [self presentModalViewController:controller animated:YES];

Help me...

+2  A: 

Can't be done. The SDK does not allow automated SMSing, for obvious reasons—your app can ask the user to hit "Send", and that's really about it.

Noah Witherspoon
Thanks Noah.....
Dinesh Kumar
A: 

See here.

rursw1
Please use comments to indicate duplicates, not answers.
Roger Pate
A: 

Here's an in App tutorial for sending SMS. Must have user consent, though, so may not be the answer you are looking for.

http://blog.mugunthkumar.com/coding/iphone-tutorial-how-to-send-in-app-sms/

Jordan
Thanks Jordan...but in this tutorial only i found the code added above for which user has to select sms button manually....
Dinesh Kumar
Can't be done without user explicit consent.
Jordan