javascript - Cordova - Open native email app from button click - Stack Overflow

When writing a native IOS app for example, you can open the native "Mail" app from a button c

When writing a native IOS app for example, you can open the native "Mail" app from a button click within an app. The email will e up pre-filled with certain data (send-to address, subject, body, etc.).

How can I simulate this across all devices using HTML5/Javascript in my cordova app?

When writing a native IOS app for example, you can open the native "Mail" app from a button click within an app. The email will e up pre-filled with certain data (send-to address, subject, body, etc.).

How can I simulate this across all devices using HTML5/Javascript in my cordova app?

Share Improve this question asked Nov 26, 2014 at 3:06 Alan WestAlan West 31 silver badge3 bronze badges 1
  • you can also try this plugin – turtle Commented Nov 26, 2014 at 5:52
Add a ment  | 

2 Answers 2

Reset to default 8

Using HTML5, you can do this with an anchor tag in your .html file. Here is an example:

<a href="mailto:[email protected]?subject=Example Subject 
&body=Thanks for the help!">Send an email</a>

This will work across all devices and resort to native functionality to handle the email task.

Also, since cordova 3.6.3 you alo need to include the following permission in your config.xml.

<access origin="mailto:*" launch-external="yes"/>

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1743717212a4495196.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信