Skip to content

Instantly share code, notes, and snippets.

@mladjan
Created October 26, 2011 10:35
Show Gist options
  • Save mladjan/1315995 to your computer and use it in GitHub Desktop.
Save mladjan/1315995 to your computer and use it in GitHub Desktop.
-(IBAction)sendEmail{
MFMailComposeViewController *controller = [[MFMailComposeViewController alloc] init];
controller.mailComposeDelegate = self;
recipients = [[NSArray alloc] initWithObjects:@"labs@meilleurtaux.com", nil];
[controller setToRecipients:recipients];
[controller setSubject:@"Application meilleurtaux.com – Suggestion."];
[controller setMessageBody:@"" isHTML:NO];
[self presentModalViewController:controller animated:YES];
[[controller navigationBar] setTintColor:[UIColor colorWithRed:237.0f/255.0f green:152.0f/255.0f blue:51.0f/255.0f alpha:1.0f]];
UIImage *image = [UIImage imageNamed: @"MTheaderHeight42.png"];
UIImageView * iv = [[UIImageView alloc] initWithFrame:CGRectMake(0,0,320,42)];
iv.image = image;
iv.contentMode = UIViewContentModeCenter;
[[[controller viewControllers] lastObject] navigationItem].titleView = iv;
[[controller navigationBar] sendSubviewToBack:iv];
[iv release];
[controller release];
}
- (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error {
[self becomeFirstResponder];
[self dismissModalViewControllerAnimated:YES];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment