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

Native Development

Reply
Regular Contributor
cmr1990
Posts: 59
Registered: ‎10-16-2013
My Device: Z10
My Carrier: vodaphone
Accepted Solution

Email not getting send

I need to send an email through my application, silently without user interaction.

The example mentioned here 

https://developer.blackberry.com/native/documentation/cascades/device_platform/pim/messages.html

does not help, for MessageBuilder does not have a default constructor.

it has a static method create, that needs an account ID.

i'm unable to gather inputs to retrive this account ID for email.

as mentioned here

http://supportforums.blackberry.com/t5/Native-Development/Send-email-is-getting-failed-on-personal-s...

using a default account gives the account ID as -1 and dint help either. 

Need to find the valid account ID for email accounts.

Please help!!

Please use plain text.
Developer
BBSJdev
Posts: 6,089
Registered: ‎07-05-2012
My Device: Playbook, Z10 LE, Dev Alpha C
My Carrier: Orange

Re: Email not getting send

Welcome to the forums.

 

I'm not sure this is possible, you could interact with a server for silent emailing?


If you've been helped click on Like Button, if you've been saved buy the app. :smileyhappy:

Developer of stokLocker, Sympatico and Super Sentences.
Please use plain text.
Regular Contributor
cmr1990
Posts: 59
Registered: ‎10-16-2013
My Device: Z10
My Carrier: vodaphone

Re: Email not getting send

I'm not sure i m getting your answer, what i ment to say was :

MessageBuilder* _builder = (MessageBuilder::create(_accountID));

I'm unable to get the '_accountID' for email account, like for sms-mms we would provide,

 

QList<Account> account_list = _accountService->accounts(Service::Messages, "sms-mms");

// save its internal ID value for future API calls
_smsAccountId = account_list.first().id();

 

I want to do the same for Email messages.

Help!!

Please use plain text.
Retired
PBernhardt
Posts: 749
Registered: ‎12-16-2008
My Device: BlackBerry Z30
My Carrier: Bell

Re: Email not getting send

You should be able to get a default account if one is set up (is there an email account on the device you tested with?), but you could also go through the list of accounts returned from accountService::accounts (Service::Typeservice) and pick the one you want.

Paul Bernhardt
Application Development Consultant
BlackBerry
@PBernhardt

Did this answer your question? Please accept this post as the solution.
Found a bug? Report it to the Developer Issue Tracker
Please use plain text.
Regular Contributor
cmr1990
Posts: 59
Registered: ‎10-16-2013
My Device: Z10
My Carrier: vodaphone

Re: Email not getting send

Set the default account on the device, and it worked :smileyvery-happy:

Thanks a tonn!! :smileyvery-happy:

Please use plain text.