I found email composer sample code from iphone OS Ref Library. Here is a code-
Code:
NSArray *toRecipients = [NSArray arrayWithObject:@\"first@exampl
MFMailComposeViewController* controller = [[MFMailComposeViewController alloc] init];
controller.mailComposeDelegate = self;
[controller setToRecipients:arr];
[controller setCcRecipients:arr2];
[controller setBccRecipients:arr3];
[controller setMessageBody:@"Hello there." isHTML:NO];
Use this code. To Give a Email address as user input only.
MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
picker.mailComposeDelegate = self;
NSString *msgTitle = @"Sample Title";
[picker setSubject:msgTitle];
NSArray *toRecipients =[[NSArray alloc] init];
NSArray *ccRecipients =[[NSArray alloc] init];
NSArray *bccRecipients =[[NSArray alloc] init];
[picker setToRecipients:toRecipients];
[picker setCcRecipients:ccRecipients];
[picker setBccRecipients:bccRecipients];
NSString *sum = @"The Email Body string is here";
NSString *emailBody;
emailBody = [NSString stringWithFormat:@"%@",sum];
[picker setMessageBody:emailBody isHTML:YES];
[self presentModalViewController:picker animated:YES];
[picker release];
-(void)launchMailAppOnDevice
{
NSString *recipients = @"mailto:?cc=,&subject=@";
NSString *body = @"&body=";
NSString *email = [NSString stringWithFormat:@"%@%@", recipients, body];
email = [email stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:email]];
}
Best of luck.