Question

I'm trying to open iOS's mail application by clicking a button.

So I did this :

NSString *mailString = [NSString stringWithFormat:@"mailto://test@test.com"];   
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:mailString]];

But nothing in particular happens... what's the problem ?

Thanks for your advices

Was it helpful?

Solution

@"mailto:test@test.com"

instead of

@"mailto://test@test.com"

Better way of doing this would be to use MFMailComposeViewController

OTHER TIPS

And it works only on the real device, not on the simulator (in my case)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top