Xcode provide MessageUI framework to send SMS from your ios application. This provide facility to send any text message from your application directly. Below steps will help to integrate SMS facility provided by Xcode,

1.    Import the MessageUI Framework into your project
#import <MessageUI/MessageUI.h>

2.    Write below method for any action control. We take button as example here,
(IBAction) sendInAppSMS:(id) sender
MFMessageComposeViewController *controller = [[[MFMessageComposeViewController alloc] init] autorelease];
if([MFMessageComposeViewController canSendText])
controller.body = @”Hello from Mugunth”;
controller.recipients = [NSArray arrayWithObjects:@”12345678″, @”87654321″, nil];
controller.messageComposeDelegate = self;
[self presentModalViewController:controller animated:YES];

3.    Do not forget to check that does your device support send SMS facility using canSendText method. If application doesn’t check this condition then it may cause crash for those device which are not support such a facility. Application can check this using below statement,
[MFMessageComposeViewController canSendText].

4.    Implement below Delegate methods in your controller. Add MFMessageComposeViewControllerDelegate and UINavigationControllerDelegate in .h file,
yourController.delegate = self;

(void)messageComposeViewController:(MFMessageComposeViewController *)controller didFinishWithResult:(MessageComposeResult)result
switch (result) {
case MessageComposeResultCancelled:
case MessageComposeResultFailed:
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@”MyApp” message:@”Unknown Error” delegate:self cancelButtonTitle:@”OK” otherButtonTitles: nil];
[alert show];
[alert release];
case MessageComposeResultSent:


[self dismissModalViewControllerAnimated:YES];