compose mail view controller with in application in iPhone and iPad development

iOS 3.2 and later apple provides a framework called  messageUI  framework to achieve Mail composing .

so first we need to add this framework in your project, Hope that we aware of adding a framework.
then just add these lines where you want in your app.

MFMailComposeViewController* controller = [[MFMailComposeViewController alloc] init];
controller.mailComposeDelegate = self;
[controller setSubject:@”My Subject”];
[controller setMessageBody:@”Hello there.” isHTML:NO];
if (controller) [self presentModalViewController:controller animated:YES];
[controller release];

and for call back implement this delegate method

(void)mailComposeController:(MFMailComposeViewController*)controller
didFinishWithResult:(MFMailComposeResult)result
error:(NSError*)error;
{
if (result == MFMailComposeResultSent) {
NSLog(@”It’s away!”);
}
[self dismissModalViewControllerAnimated:YES];
}

One Reply to “compose mail view controller with in application in iPhone and iPad development”

  1. Hey my friends I tell you some tips about Be very careful with the timing of your nitrous. Generally speaking, it's a little wasted while you're shifting up the first couple of gears. We found the best time to activate it is after you've shifted up twice at the earliest. Make sure that you're not about to hit a drift section though, otherwise you'll waste this very useful boost.
    RPG Finder

Leave a Reply

Your email address will not be published. Required fields are marked *