Mails sent from within app will only use the default mail account in Settings.
EDIT:
Here is a sample sendEmail() method:
-(IBAction) sendEmail{
if(![MFMailComposeViewController canSendMail]){
//show info msg to user
return;
}
MFMailComposeViewController *controller = [[MFMailComposeViewController alloc] init];
controller.mailComposeDelegate = self;
[controller setSubject:@"Hello"];
[controller setMessageBody:@"How are you?" isHTML:NO];
[controller addAttachmentData:UIImageJPEGRepresentation(myImage,0.8) mimeType:@"image/jpeg" fileName:@"fileName.jpg"];
[self presentModalViewController:controller animated:YES];
[controller release];
}
You will need the addAttachmentData
method for attachments.
You will also need to implement the didFinishWithResult method to discard the MFMail controller
-(void) mailComposeController:(MFMailComposeViewController *)controller didFinishWithResult:(MFMailComposeResult) result error:(NSError *) error{
[self becomeFirstResponder];
[self dismissModalViewControllerAnimated:YES];
}
Make sure your the class where you write these methos implements the < MFMailComposeViewControllerDelegate > protocol
Hope this helps!