简体   繁体   中英

Can't send email with Intel XDK

I was all day trying to find a way to send an Email from an app I'm creating in Intel XDK (with Cordova)

Now, I don't really know how Cordova works, I just know HTML, CSS and JS, but I can't figure out why this isn't working.

This is my HTML:

    <script src="cordova.js"></script>
    <script src="js/app.js"></script>
    <script src="xdk/init-dev.js"></script>
</head>

 <body>
  <section class="modal_buttons_st">
   <button onclick="cerrarModal();" id="modal_cerrar" class="modal_button">Modificar</button>
   <button onclick="draftEmail();" id="modal_send" class="modal_button">Enviar por Mail</button>
  </section>
  <script src="assets/js/jquery.js"></script>
  <script src="assets/js/app.js"></script>
 </body>
</html>

(You can see I'm calling draftEmail(); on click of one of the buttons at the end)

And this is the section of my app.js that contains the function

function draftEmail() {
    var bodyText = 'Sample Text';
    intel.xdk.device.sendEmail(bodyText, "some@direction.com", "Sample Title", true, "", "" ); 
}

I have selected the device plugin and it shows as installed when I build, just when I click the button, nothing at all happens

Thanks and sorry for bad english

Hi first of all you have to add the permission to the apk to access to external like call or send mails, so you must add the access on the whitelist get sure to add in the correct build (iOS, android, crosswalk etc), and u have to add mailto:* where it said intent (external whitelist).

other important thing is if you emulate the apk it will open probably microsoft outlook so always for test that build the apk and try on real phones.

hope that helps you and sorry for the bad english to =)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM