Created
March 4, 2016 00:21
-
-
Save tatetate55/bcf1145aba131fe710c2 to your computer and use it in GitHub Desktop.
メール送信objc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (IBAction)sendButton:(id)sender { | |
// メールビュー生成 | |
MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init]; | |
picker.mailComposeDelegate = self; | |
// 半角スペースを区切りとして文字列を分割 | |
NSArray *toAddressArray = [self.toAddress.text componentsSeparatedByString:@","]; | |
[picker setToRecipients:toAddressArray]; | |
// 半角スペースを区切りとして文字列を分割 | |
NSArray *ccAddressArray = [self.ccAddress.text componentsSeparatedByString:@","]; | |
[picker setCcRecipients:ccAddressArray]; | |
// メール件名 | |
[picker setSubject:self.titleLabel.text]; | |
// メール本文 | |
[picker setMessageBody:self.mainText.text isHTML:NO]; | |
// メールビュー表示 | |
[self presentViewController:picker animated:YES completion:nil]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment