Quantcast
Channel: User kubi - Stack Overflow
Viewing all articles
Browse latest Browse all 39

Answer by kubi for Objective C: Send email without leaving app

$
0
0

Yes. Use the MFMailComposeViewController.

// From within your active view controllerif([MFMailComposeViewController canSendMail]) {    MFMailComposeViewController *mailCont = [[MFMailComposeViewController alloc] init];    mailCont.mailComposeDelegate = self;    [mailCont setSubject:@"yo!"];    [mailCont setToRecipients:[NSArray arrayWithObject:@"joel@stackoverflow.com"]];    [mailCont setMessageBody:@"Don't ever want to give you up" isHTML:NO];    [self presentViewController:mailCont animated:YES completion:nil];}// Then implement the delegate method- (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error {    [self dismissViewControllerAnimated:YES completion:nil];}

Viewing all articles
Browse latest Browse all 39

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>