2

Application is sending email by using MFMailComposeViewController, everything works just fine. However after sending email, the recipient address needs to be stored for further processing. As far as I can tell, there is no API for this.

How do I get the email address where message was sent to?

  • Should I subclass MFMailComposeViewController and override something? What would that be?
  • Could I find email address by looking at MFMailComposeViewController view hierarchy? What would I be looking for there?

Any other ideas?

JOM
  • 8,139
  • 6
  • 78
  • 111
  • That is something I'd love to know as well. Of couse you could add an email address to your app's settings and use that to provide an email address that makes sense to the user as a default recipient, but that does not seem elegant to me. – mvexel Jan 13 '11 at 07:10
  • Sorry, most likely different problem? Giving default is no problem, but I needed to know the real exact used email addresses. Could dig out one, but not more. Stopped at that point, since got a feeling it was possible cause for rejection at AppStore. – JOM Jan 13 '11 at 16:34

2 Answers2

1

Figured out a partial answer, here's the details:

http://jomnius.blogspot.com/2011/02/how-to-find-mfmailcomposeviewcontroller.html

Problems: it finds the recipient email address(es), but only if that fits in about 35 character text string. Otherwise you find only a summary string like "aaa@aaa.aa & 2 more...". So where are the actual email addresses in this case?

JOM
  • 8,139
  • 6
  • 78
  • 111
0

As an alternate UI flow -- though obviously I don't know your app, so only you'll know whether this can work -- you could instead have the user enter recipient info into a textfield and then push the mail composition viewcontroller (with the recipient(s) pre-filled).

You could even use a variation of Joe Michel's Multi-Recipient Picker library to make it feel more like the native recipient selection.

Matthew Frederick
  • 22,245
  • 10
  • 71
  • 97
  • Email composer view let's user change recipient email address(es), thus all proposals to pre-fill, pre-request, pre-whatever following normal email composer view is just... how to say... not solving the problem. Not worth the trouble, if you cannot rely on the solution. But agree that in some cases it might be good enough. – JOM Apr 03 '11 at 09:50