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
icq782443
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.
Please use plain text.
Developer
scrid2000
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)

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



Please use plain text.
Contributor
icq782443
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?

Please use plain text.
Developer
scrid2000
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.

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



Please use plain text.
Contributor
icq782443
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.
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 ]

On your PlayBook or in the simulator?

Please use plain text.
Developer
scrid2000
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?

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



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?

That's right.

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

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 ]

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. 

Please use plain text.
Developer
scrid2000
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!
-----------------------------------------------------------------------------------------



Please use plain text.