mfmailcomposeviewcontroller cansendmail returning no?

This is a strange issue. I have an application that creates an email for the user to send. Everything appears to work, except that one of my users is reporting he can't get it to send. It displays my "no accounts configured blah blah blah" error. Which is strange because from what I can tell, he does have a valid email account set up that he can send from on the phone. He's not particularly tech savvy, so I am going to be working with his IT group later to try and get some more details.


Basically, my question is this: under what circumstances will mfmailcomposeviewcontroller cansendmail return false?

Replies

I've moved this question to the Cocoa Touch forum, since the API you're asking about is in iOS. Is it possible that the account is a managed account? If so, then I suspect that is why it's not being considered eligible for use with the mail compose controller.

Thanks, I didn't realize I'd posted to the wrong place. I believe it is a managed account added via an MDM (Maas360 according to their IT guy). What's weird is that the IT guy (I had him and the user on speaker just now) was able to use the app without issue. Very strange.

Hi pdm,


I have the same problem and it definately has to do with a configuration profile via MDM or Apple Configurator.

What I found is that if you setup an email account with a configuration profile the MFMailComposeViewController returns false from canSendMail if this email account is the only one on the device.

The option to restrict the email to only the mail app, had no effect on that. It was present wether the option was checked or not.


I filed a bug with a sample project that illustrates that. The report id is 30443554

Thanks for the bug report. It's with the mail engineering team for them to have a look at. If there's anything I can report back here I'll do so.

Hi,

i am having the same issue. Have you solved this issue?