I got an error :
viewServiceDidTerminateWithError: Error Domain=_UIViewServiceInterfaceErrorDomain Code=3 "The operation couldn’t be completed. (_UIViewServiceInterfaceErrorDomain error 3.)" UserInfo=0x7c3f4600 {Message=Service Connection Interrupted}
if([MFMailComposeViewController canSendMail])
{
MFMailComposeViewController *mail = [[MFMailComposeViewController alloc] init];
mail.mailComposeDelegate = self;
[mail setSubject:@"Contact"];
[mail setMessageBody:@"Here is some main text in the email!" isHTML:NO];
[mail setToRecipients:@[self.salonemail.text]];
[self presentViewController:mail animated:YES completion:NULL];
}
else{
[self showAlert:@"Looks like your device can't send emails"];
}
- (void)mailComposeController:(MFMailComposeViewController *)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError *)error
{
[self dismissViewControllerAnimated:YES completion:NULL];
}