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

Posts: 18
Registered: ‎12-20-2010
My Device: bold
My Carrier: webmaster
Accepted Solution

sending email in a widget



I was wondering how to send emails in a web app ?

I've tried this code :


function send_mel(){

var args = new blackberry.invoke.MessageArguments('foo@domain.com', 'hello', 'world');
args.view = blackberry.invoke.MessageArguments.VIEW_NEW; // New
blackberry.invoke.invoke(blackberry.invoke.APP_MESSAGES, args);



and in my config.xml :


<feature id="blackberry.message" required="true" version="1.0.0"/>
<feature id="blackberry.identity" required="true" version="1.0.0"/>
<feature id="blackberry.find" required="true" version="1.0.0"/>
<feature id="blackberry.invoke.MessageArguments" required="true" version=""/>


when I launch the function (testing in the simulator I get this message :




So what's wrong with this code ?


Thanks for the response.



Posts: 1,382
Registered: ‎07-02-2009
My Device: BlackBerry Bold 9900
My Carrier: Bell

Re: sending email in a widget

You almost have it Smiley Happy


You need to add the following feature element to alow the invoke feature to work:



  <feature id="blackberry.invoke" required="true" version=""/>



Follow me on Twitter: @n_adam_stanley
Your app doesn't work? Use BlackBerry remote web inspector to find out why.
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: sending email in a widget

Also, if you just want to send an email without popping up the email application.. you can do so with the following api:





<script type="text/javascript">
  var message = new blackberry.message.Message();
  message.toRecipients = "noone@blackberry.com";
  message.subject = "Hello";
  message.body = "World";



Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
Posts: 18
Registered: ‎12-20-2010
My Device: bold
My Carrier: webmaster

Re: sending email in a widget

thanks a lot, this helped me a lot :-)

Regular Contributor
Posts: 56
Registered: ‎08-21-2012
My Device: BB10
My Carrier: RIM

Re: sending email in a widget


I'm trying the same but getting Exception: 'undefined' is not a constructor. Am I missing something? I'm installing this in Blackberry-10's beta4 simulator and the webworks SDK version is