r/iOSProgramming • u/seanpuppy • May 05 '18
Can't send email because email account set up IPhone Simulator
Hello, I am trying to implement the ability to send emails from my app and I believe I have everything setup properly yet it can not recognize a valid email account on the simulator. I have even logged in on my own icloud account on the simulator but still do not have any success. I am not even trying to physically send an email, just make sure my custom email subject and body pop up.
When I use the debugger the following line is False
MFMailComposeViewController.canSendMail() Here is the main block of code that fails and brings up the email not found alert box
let mailComposeViewController = configureMailComposeViewController()
if MFMailComposeViewController.canSendMail() {
self.present(mailComposeViewController, animated:true, completion: nil)
} else {
self.showSendMailErrorAlert()
}I am getting pretty stumped on this as I have no ideas on how else to enable an email account on the simulator, especially considering there is no way to install the email app on the simulator. Any help is appreciated, thanks.
15
u/BadgerBadgerNarwhal May 05 '18
You can't use the mail composer view controller on the simulator. You will need a real device with Mail setup on it.