How to get iOS device configured emails?

******** Support Needed ***********
Hi all,


We have developed an iOS application using Objective C and the app is successfully deployed to AppStore, this app is used by various clients and their employees using MDM or app store.

One of the common functionality of our app is to allow a user to send emails based on the Business case. We are using MFMailComposeViewController to send an email. We recently got into a new requirement from one of our PRIMARY clients.


here is the requirement

“ If a device is registered using the client's company email account then only he/she can send an email, our app should show a toast message if

  1. The email account is not configured or
  2. The company account is configured but outgoing is blocked.
  3. In case if the device has both company and personal account then only company account should be visible"


I am aware that MFMailComposeViewController provides a method setPreferredSendingEmailAddress that allows setting email as the preferred sender but I am unable to find a way to disallow other personal accounts.


Is there any way that checks if some email id (string) is one of the configured email accounts? Here I just need to check if the given email is configured in the email app or not.


I am struggling with this from the last couple of days and unable to find any solution yet. Some of the open thread suggests to use private API but I don’t want to go through that route as it’s a security risk.


This is a high PRIORITY ISSUE for us, any help or guidance would be helpful.

Thanks!

Manish Kumar

Can I get any help here?

How to get iOS device configured emails?
 
 
Q