---
title: "How to send Emails in iPhone"  
description: "How to send Emails in iPhone"  
author: "Barbara Jones"  
published: 2015-02-19  
updated: 2015-02-19  
canonical: https://www.mindstick.com/forum/12965/how-to-send-emails-in-iphone  
category: "iphone"  
tags: ["iphone", "ios"]  
reading_time: 1 minute  

---

# How to send Emails in iPhone

How to send Emails in iPhone ?

## Replies

### Reply by Anonymous User

Follow these steps **:**

**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 SendEmail : UIViewController<MFMailComposeViewControllerDelegate>@property (retain, nonatomic) NSString *emailSubject;@end
```

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

```
  MFMailComposeViewController  *mailcontroller =[[MFMailComposeViewController alloc] init];  mailcontroller.mailComposeDelegate =self; // CHECK DEVICE CAN SEND EMAIL if([MFMailComposeViewController canSendMail]){ // Email subject.       mailcontroller.subject=@“this is email subject. ”; //  Email body    mailcontroller.body=[NSString stringWithFormat:@“ This is the testing email. “];  // Email address you want to send .         mailcontroller.recipients = [NSArray arrayWithObjects:@”example@.com”,nil];        // check the condition in case of model view controller is not dismissed then dismiss it.                 if (![[self presentedViewController] isBeingPresented]) {                    [self dismissViewControllerAnimated:YES completion:nil];                                 }// show Email view  UI.[self presentViewController:mailcontroller animated:YES completion:nil];            }  // delegate method of  MFMailComposeViewController .  -(void)mailComposeController:(MFMailComposeViewController *)controller         didFinishWithResult:(MFMailComposeResult)result error:(NSError *)error{         [controller dismissViewControllerAnimated:YES completion:nil];  }
```


---

Original Source: https://www.mindstick.com/forum/12965/how-to-send-emails-in-iphone

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
