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


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Contributor
Posts: 22
Registered: ‎02-21-2012
My Device: Playbook torch 9800
My Carrier: Telus

Re: How to programatically send email using Playbook 2.0?

@scrid2000 Have you included <feature id="blackberry.invoke" required="true" version="1.0.0.0"/> in your config.xml file?
You you should also have remote.makeAsyncCall(); at the end of your function.
Developer
Posts: 142
Registered: ‎07-27-2011
My Device: Red Z10, 32GB PlayBook, Numerous Android/WP8/FirefoxOS/Other devices
My Carrier: T-Mobile

Re: How to programatically send email using Playbook 2.0?

[ Edited ]

Thanks for the help icq.
I just tried:

<script>
function launchMail() { 
var remote = new blackberry.transport.RemoteFunctionCall("blackberry/invoke/invoke");
remote.addParam("appType", "mailto:?Subject=SubjectStr&body=" + encodeURIComponent(BodyStr));
remote.makeAsyncCall();
}
</script>
<img src="img/messages.png" onclick="launchMail()" />

 



and still no go. :confused:

Yes, I have <feature id="blackberry.invoke" required="true" version="1.0.0"/> in the config.

Not sure what's going on.

 

(edit - added the () to the launchMail command, left it out of the forum post by mistake)

-----------------------------------------------------------------------------------------



Contributor
Posts: 22
Registered: ‎02-21-2012
My Device: Playbook torch 9800
My Carrier: Telus

Re: How to programatically send email using Playbook 2.0?

[ Edited ]

your onClick shoud be onClick="launchMail()" let me know if that helps.

 

and I assume you are defining BodyStr somewhere right?

Developer
Posts: 142
Registered: ‎07-27-2011
My Device: Red Z10, 32GB PlayBook, Numerous Android/WP8/FirefoxOS/Other devices
My Carrier: T-Mobile

Re: How to programatically send email using Playbook 2.0?

Ah right, yeah in the code it is "onClick="launchMail()", that was a forum post typo on my end.

I'm not defining a body string, actually in a more recent attempt I just tried to launch "mailto:email@email.com" and it was no go.

-----------------------------------------------------------------------------------------



Highlighted
Contributor
Posts: 22
Registered: ‎02-21-2012
My Device: Playbook torch 9800
My Carrier: Telus

Re: How to programatically send email using Playbook 2.0?

remote.addParam("appType", "mailto:?Subject=SubjectStr&body=Test");

Try the above line... I'm now on the road so I'm afraid I can't help much more.
Developer
Posts: 117
Registered: ‎02-29-2012
My Device: PlayBook & Nexus 4

Re: How to programatically send email using Playbook 2.0?

[ Edited ]

On your PlayBook or in the simulator?

Developer
Posts: 142
Registered: ‎07-27-2011
My Device: Red Z10, 32GB PlayBook, Numerous Android/WP8/FirefoxOS/Other devices
My Carrier: T-Mobile

Re: How to programatically send email using Playbook 2.0?

On the PlayBook. There's no email client on the simulator is there?

-----------------------------------------------------------------------------------------



Developer
Posts: 117
Registered: ‎02-29-2012
My Device: PlayBook & Nexus 4

Re: How to programatically send email using Playbook 2.0?

That's right.

I'll have a look at my setup when I get home.

Developer
Posts: 117
Registered: ‎02-29-2012
My Device: PlayBook & Nexus 4

Re: How to programatically send email using Playbook 2.0?

[ Edited ]

In my config.xml I use

 

<feature id="blackberry.invoke" />

Your code (with body=Test as suggested by icq782443) runs as expected on my PB. You need to make sure the makeAsyncCall() statement is reached. 

Developer
Posts: 142
Registered: ‎07-27-2011
My Device: Red Z10, 32GB PlayBook, Numerous Android/WP8/FirefoxOS/Other devices
My Carrier: T-Mobile

Re: How to programatically send email using Playbook 2.0?

Thanks a ton guys, got it working!
-----------------------------------------------------------------------------------------