email - Phonegap - Send mail from app -
i need add button on app, send suggest mail gmail.
i tried methods none of them worked.
i trying, this:
<section data-role="page" id="home"> <article data-role="content" style="position: fixed;text-align: center;width: 100%;height: 100%;margin:0;padding:0;overflow: hidden;" > <!--<a id="go" href="#view-feed-custom"> <img style="max-width: 100%;" src="img/portada.jpg" alt="logo"> </a>--> <script> var args = { subject: 'hi there', body: 'message suggest you', torecipients: 'reciver@gmail.com' }; cordova.exec(null, null, "emailcomposer", "showemailcomposer", [args]); </script> <a href="#" onclick="cordova.exec(null, null, "emailcomposer", "showemailcomposer", [args]);">enviar sugerencia 2</a> </article> </section>
i trying both method u show me...
<body onload="init()"> <!-- start --> <section data-role="page" id="home"> <article data-role="content" style="position: fixed;text-align: center;width: 100%;height: 100%;margin:0;padding:0;overflow: hidden;" > <a id="go" href="#view-feed-custom"> <img style="max-width: 100%;" src="img/portada.jpg" alt="logo"> </a> </article> <script> function send(){ var args = { subject: 'hi there', body: 'message suggest you', torecipients: 'miemail@gmail.com' }; cordova.exec(null, null, "emailcomposer", "showemailcomposer", [args]); } </script> <button onclick='send();'>send mail onclick</button> <button href="mailto:email@email.com?cc=email2@email.com&bcc=email3@email.com&subject=the subject of email&body=the body of email">enviar correo href</button> </section>
but no run/works...
thx lot guys me!