03-09-2012 09:53 AM
I am building an app using the HTML5 Webworks SDK, and one of the features is to allow the users to send information generated from the app via email. I am targeting Playbook 2.0 since it now has a native email client, however I am not able to do this. I have tried the following with no success:
1) <a href=mailto:?subject=Application details ...
2) window.open('mailto:?subject=Application details&body=' + bodyvariable);
3) Blackberry message:
var message = new blackberry.message.Message();
message.toRecipients = "noone@blackberryWidgets.com";
message.subject = "Loan details by Loan Analyzer";
message.body = emailsubject;
Any ideas on how to programmatically send email?
Thanks for your help
Solved! Go to Solution.
03-12-2012 10:12 AM
Although there is a native mail client on Tablet OS 2.0, WebWorks applications currently do not have the ability to invoke a new email using the "mailto" scheme.
There is an open issue filed for this here:
03-13-2012 02:12 AM
03-13-2012 05:41 AM
03-14-2012 08:02 PM
Thanks all for the help. Using mailto to launch mobile gmail does not seem to be a good solution and unfortunately I am not familiar with AIR extensions. I will try to review how that works.
Anyways, I have apps programatically creating emails using web development on all other platforms (iOs, Android, Chrome, WP, WebOS), except this one. It will be best if RIM provides an option using WebWorks to resolve this.
03-17-2012 05:00 PM
Astanley, what is the best way to get inform when RIM has a solution for this issue? Is there a thread or email list that I can be added ? And do you have any insights on how long it may take?
04-11-2012 07:25 PM - edited 04-11-2012 07:58 PM
Guys, I found a simple solution to our problem:
var remote = new blackberry.transport.RemoteFunctionCall("blackberr
y/invoke/invoke"); remote.addParam("appType", "mailto:?Subject=SubjectStr&body=" + encodeURIComponent(BodyStr)); remote.makeAsyncCall();
mailto: can be followed by an email address. String SubjectStr must not contain space characters, use %20 instead. Or use encodeURIComponent() like I did for BodyStr.
For a button or <a> tag you can use the onclick() event handler to call this code.