Search code examples
iphoneobjective-cmfmailcomposeviewcontroller

Getting email address which the user has entered


Is it possible to get the email address which the user has entered?

I know it's possible to set the email address but there is no method to get one.

Is there any know solution for that?


Solution

  • According to the documentation, there is not.


    The remaining stuff I mention for the sake of answering the question, but I don't recommend that you do this, because it's likely to get your app rejected from the store.

    It's possible that MFMailComposeViewController is set up in such a way that the toRecipients is implemented internally as an @property. If that's the case, you can probably do something like:

    NSArray * recipients = [myMailComposeViewController performSelector:@selector(toRecipients)];
    

    If that doesn't work, you could maybe start finding ways to introspect the viewController's _internal ivar, or maybe just walk the view hierarchy yourself until you find what you're looking for.