0

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...

Cœur
  • 37,241
  • 25
  • 195
  • 267
Dinesh Kumar
  • 73
  • 1
  • 3
  • 13

2 Answers2

5

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
  • 57,021
  • 16
  • 130
  • 131
0

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
  • 21,746
  • 10
  • 51
  • 63