There's a lot of questions on this topic, but no updated answer. I want to open the native iOS mail app WITHOUT the compose view (from within my own app). All answers so for say it's impossible, but the app Slack manages to do this. Anyone have any idea?
Asked
Active
Viewed 5,815 times
3
-
1Where are the other questions? What have you tried? – Saltymule Mar 23 '15 at 09:24
-
1google forums, stackoverflow, etc. – Allen Mar 23 '15 at 09:24
-
A word of advice: do not blindly trust your users. People may or may not have configured the mail-app you're trying to use. – Edwin Lambregts Mar 23 '15 at 09:25
-
2http://stackoverflow.com/questions/8821934/launch-apple-mail-app-from-within-my-own-app "Since the only way to launch other applications is by using their URL schemes, the only way to open mail is by using the mailto: scheme. Which, unfortunately for your case, will always open the compose view." – Allen Mar 23 '15 at 09:25
-
@EdwinLambregts regardless, i would like to know how to achieve this – Allen Mar 23 '15 at 09:26
-
How does the link you have supplied in the comment not answer your question? It is basically saying this isn't possible the way to open the Mail App is by using `mailto:` url scheme which will open it in compose view or you could use the hidden url scheme `message:` which also opens it in a compose view. There is no way of getting it to open in any other way. It's just not possible. – Popeye Mar 23 '15 at 13:41
-
@Popeye nope, i just realized the urlscheme of message: -> this does not open it in compose view – Allen Mar 23 '15 at 13:47
-
@Allen are you sure because that link `Vladimir` has supplied seems to say it will open the composer view with the message you pass in. – Popeye Mar 23 '15 at 13:51
-
no i just tried it...it works great. – Allen Mar 23 '15 at 13:51
1 Answers
20
You can launch mail app using message://
url scheme, e.g.
NSURL* mailURL = [NSURL URLWithString:@"message://"];
if ([[UIApplication sharedApplication] canOpenURL:mailURL]) {
[[UIApplication sharedApplication] openURL:mailURL];
}
I was not able to find any information about it in apple documentation, but the scheme is present in URL schemes section (not private urls!) in mail's Info.plist, so I assume it is a part of a public api. You can also find some information on the topic here

Luke Melia
- 8,389
- 33
- 41

Vladimir
- 170,431
- 36
- 387
- 313
-
awesome! I was trying to guess what the urlscheme was but mail:// was n't working for me – Allen Mar 23 '15 at 13:42
-
1That `if statement` doesn't read correctly. Is that correct? Shouldn't it be `if ([[UIApplication SharedApplication] canOpenURL:mailURL])`???? – Popeye Mar 23 '15 at 13:42
-
-
1Great to find this! Do you know if we can use that URL scheme so that Mail app opens an e-mail file (_.msg_ from Outlook or similar) giving a URL where the file is hosted? So something like `message://http://domain/file.msg`. – Alex MM Jun 10 '16 at 14:32