---
title: "How to send messages in iPhone"  
description: "How to send messages in iPhone"  
author: "Lillian Martin"  
published: 2015-02-19  
updated: 2015-02-19  
canonical: https://www.mindstick.com/forum/12966/how-to-send-messages-in-iphone  
category: "iphone"  
tags: ["iphone", "ios"]  
reading_time: 1 minute  

---

# How to send messages in iPhone

How to send [messages](https://www.mindstick.com/news/4166/google-rolling-out-gemini-extensions-for-messages-whatsapp-and-spotify) in iPhone ?

## Replies

### Reply by Allen Scott

Few steps will led u to understand the simple implementation involved in it:

**Step.1**-Include **MessageUI.framework** in your project.

**Step-2** Import **MessageUI/MessageUI.h in your header** file like that in my case.

```
#import <MessageUI/MessageUI.h>#import <UIKit/UIKit.h>#import <QuartzCore/QuartzCore.h> @interface SendSMS : UITableViewController<MFMessageComposeViewControllerDelegate>@property (retain, nonatomic) NSString *SMSSubject;@end
```

**Setp-3** Suppose you want to send SMS on button touch(click) then write the following code in your implementation (SendSMS.m) file.

```
  MFMessageComposeViewController *controller =[[MFMessageComposeViewController alloc] init];     controller.messageComposeDelegate = self; // CHECK DEVICE CAN SEND TEXT MESSAGE.     if([MFMessageComposeViewController canSendText]){// message subject. controller.subject=@“this is message subject. ”;//  message body controller.body=[NSString stringWithFormat:@“ This is the testing message. “];// contact number you want to send . controller.recipients = [NSArray arrayWithObjects:@” 123456”,nil];           // check the condition in case of model view controller is not dismissed.                if (![[self presentedViewController] isBeingPresented]) {                    [self dismissViewControllerAnimated:YES completion:nil];                                 }// show message view  UI.[self presentViewController: controller animated:YES completion:nil];            } // delegate method of  MFMessageComposeViewController . - (void)messageComposeViewController:(MFMessageComposeViewController *)controller didFinishWithResult:(MessageComposeResult)result{      [controller dismissViewControllerAnimated:YES completion:nil];}
```


---

Original Source: https://www.mindstick.com/forum/12966/how-to-send-messages-in-iphone

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
