I want to send an email from my iPhone application. I have heard that the iOS SDK doesn\'t have an email API. I don\'t want to use the following code because it will exit my
Swift 2.0
func mailComposeController(controller: MFMailComposeViewController, didFinishWithResult result: MFMailComposeResult, error: NSError?){
if let error = error{
print("Error: \(error)")
}else{
//NO Error
//------------------------------------------------
var feedbackMsg = ""
switch result.rawValue {
case MFMailComposeResultCancelled.rawValue:
feedbackMsg = "Mail Cancelled"
case MFMailComposeResultSaved.rawValue:
feedbackMsg = "Mail Saved"
case MFMailComposeResultSent.rawValue:
feedbackMsg = "Mail Sent"
case MFMailComposeResultFailed.rawValue:
feedbackMsg = "Mail Failed"
default:
feedbackMsg = ""
}
print("Mail: \(feedbackMsg)")
//------------------------------------------------
}
}