Reputation: 54121
I have a UIWebView
in an iPhone app and want to intercept structured mailto-URLs like mailto:[email protected]?subject=foo&body=bar
in order to display a MFMailComposeViewController
inside the app instead of handing over the URL to Mail.app.
Now it would be great if all properties of MFMailComposeViewController
would be automatically set according to the mailto URL. Unfortunately, MFMailComposeViewController
does not accept a mailto URL but requires to set the individual properties.
NSURL apparently is not of great help either. Are you aware any existing code so that I don't have to write the parser code? ;)
Upvotes: 4
Views: 1547
Reputation: 6035
Ortwin, thanks for your code. I forked it to add a check on the canSendMail method and to add it as a category of MFMailComposeViewController. Please, find it here: https://gist.github.com/788075
Upvotes: 2
Reputation: 54121
Wrote my own solution: https://gist.github.com/667952 It's a bit ugly and probably not 100% foolproof in terms of RFC support, but as long as the syntax of the mailto URLs is under your own control, it works fine.
Upvotes: 14