问题
The url to launch email and start a new email on an iphone is "mailto://someone@somwhere.com". I just want to launch the email app, dropping the user at the main menu, or inbox.
"mailto:" starts composing a new blank email
I've tried "mail:", "email:" and a few others. Is there no way to just launch the email app?
回答1:
I don't think so, since the whole idea of the url schemes is to launch another app given some context in your own app. Watch a specific YouTube vid, write an email, etc.
in addition, this sounds like a weird requirement - why would you just want to send them to their email client without having them compose an email?
回答2:
This is now possible since iOS 7 using message ID tricks. Use the URL message:<messageID>
with a dummy Message ID (such as 0).
See this blog post for more info :
A happy by-product of this URL scheme and behavior is that you can use a dummy string for the message-id to just launch the Mail app without deep linking to a specific email. This can enable scenarios where an app may want to launch the user directly into their inbox e.g. to verify their email address to complete the signup process.
回答3:
Have you tried using an invalid email address? Something like mailto://!!!
?
回答4:
From the documentation (highlight added).
The mailto scheme is used to launch the Mail application and open the email compose sheet. When specifying a mailto URL, you must provide the target email address.
So it does not appear you can do what you want.
-t
回答5:
No, you can't.
;)
Along the lines of what Tim said, since the handling of the URL is automatic and trying to degrade the URL to where the Mail app somehow throws up and just shows the menu could give undesirable results in App Review or in future OS/Mail App versions, you might not like it even if you make it work. You might want it, but that's another thing :)
If you want to 'just start the app', look here. http://iosdevelopertips.com/cocoa/launching-other-apps-within-an-iphone-application.html
来源:https://stackoverflow.com/questions/1942689/iphone-email-app-launch-url