Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
Contributor
RosendoLSL
Posts: 36
Registered: ‎05-04-2010
My Device: Storm
My Carrier: Verizon
Accepted Solution

How to programatically send email using Playbook 2.0?

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;

                message.send();

 

Any ideas on how to programmatically send email?

 

Thanks for your help

Please use plain text.
Contributor
RosendoLSL
Posts: 36
Registered: ‎05-04-2010
My Device: Storm
My Carrier: Verizon

Re: How to programatically send email using Playbook 2.0?

Does any one has any feedback on this question?  I appreaciate your help, thanks!

Please use plain text.
Developer
ibarrera
Posts: 588
Registered: ‎05-29-2009
My Device: 9100

Re: How to programatically send email using Playbook 2.0?

blackberry.message is not supported by playbook

 

https://bdsc.webapps.blackberry.com/html5/apis/blackberry.message.Message.html

Please use plain text.
Administrator
astanley
Posts: 1,382
Registered: ‎07-02-2009
My Device: BlackBerry Bold 9900
My Carrier: Bell

Re: How to programatically send email using Playbook 2.0?

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:

https://github.com/blackberry/WebWorks-TabletOS/issues/53

Follow me on Twitter: @n_adam_stanley
-------------------------------------------------------------------------------------------------------------------------
Your app doesn't work? Use BlackBerry remote web inspector to find out why.
Please use plain text.
Contributor
RosendoLSL
Posts: 36
Registered: ‎05-04-2010
My Device: Storm
My Carrier: Verizon

Re: How to programatically send email using Playbook 2.0?

Adam, thanks for the info.  Any method that you know it will work  with the playbook?

Please use plain text.
Developer
taylortbb
Posts: 137
Registered: ‎10-26-2010
My Device: Bold 9900 + PlayBook
My Carrier: Rogers

Re: How to programatically send email using Playbook 2.0?

This came up recently at http://supportforums.blackberry.com/t5/Tablet-OS-SDK-for-Adobe-AIR/Invoke-native-applications/td-p/1... . I'm not sure if that's already in WebWorks or if you'll have to write your own AIR extension, but it should be pretty trivial to implement.
--------
Taylor Byrnes
Please use plain text.
Developer
eblade
Posts: 161
Registered: ‎02-08-2012
My Device: PlayBook
My Carrier: None yet

Re: How to programatically send email using Playbook 2.0?

mailto "works" here in that it fires up mobile gmail to try to do it. Probably not exactly the best solution in the world.

Please use plain text.
Contributor
RosendoLSL
Posts: 36
Registered: ‎05-04-2010
My Device: Storm
My Carrier: Verizon

Re: How to programatically send email using Playbook 2.0?

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.

Please use plain text.
Contributor
RosendoLSL
Posts: 36
Registered: ‎05-04-2010
My Device: Storm
My Carrier: Verizon

Re: How to programatically send email using Playbook 2.0?

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?

Please use plain text.
Trusted Contributor
lcocea
Posts: 117
Registered: ‎02-29-2012
My Device: PlayBook & Nexus 4

Re: How to programatically send email using Playbook 2.0?

[ Edited ]

Guys, I found a simple solution to our problem:

 

var remote = new blackberry.transport.RemoteFunctionCall("blackberry/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.

Please use plain text.