Rion
Rion

Reputation: 49

MFMailComposeViewController canSendMail returns false if the email account was added via a profile (like MDM)

a customer reported an error that a lot of users could not send email because they only got an alert that there is no email account. The alert is done in code if MFMailComposeViewController returns false from canSendMail.

We had difficulty finding out what the real problem was, but after some testing we found out, that canSendMail always returns false when the only email account available is setup via a profile (possibly MDM or something like the Apple Configurator).

The configured email has no problem receiving and sending emails in Mail itself and when it is added manually without a profile, it works as expected.

Has anyone any suggestion or a possible workaround? Maybe it is just a misconfiguration? enter image description here

Upvotes: 5

Views: 4018

Answers (1)

I had this issue and I looked longtime for the answer. This is VERY SIMPLE to solve : If you are running on simulator, evidently your simulator doesn't have a email configured. If you run on iPhone attached to Xcode will running fine. That's it Thanks

Upvotes: -2

Related Questions