03-08-2014 05:30 PM - edited 03-08-2014 06:52 PM
This describes code examples like:
... but there is no way to make a MessageBuilder object like that. It seems to require an AccountKey object:
Is it possible that the documentation is horribly out of date?!
Solved! Go to Solution.
03-08-2014 06:52 PM
After searching these forums I think I've implicitly confirmed that the code sample on BB's documentation page doesn't work, which blows my mind for something like sending an email.
bb::pim::account::AccountService accountService; bb::pim::account::Account defaultClient = accountService.defaultAccount(bb::pim::account::Se
rvice::Messages); bb::pim::account::AccountKey accountId = defaultClient.id(); // Create the message service object MessageService service; // Create the recipients for the first message MessageContact firstRecipient = MessageContact(1, MessageContact::To, "Daniel Bigham", "firstname.lastname@example.org"); // Create the first message MessageBuilder* msg1Builder = MessageBuilder::create(accountId); Message firstMessage = msg1Builder->subject("Photos for you") .body(MessageBody::PlainText, QByteArray("")) .addRecipient(firstRecipient); // Send the first message using the message service object service.send(1, firstMessage);
... but when I execute the code, I get the following printed in the console:
Exception String "The RPC service Account:1 has no message_send command"
ErrorInfo MessageServicePrivate::handleResponse The RPC service Account:1 has no message_send command : 500 methodid EMS::send
Does anyone out there have a working example of how to send an email message from a BB10 Cascades app?
03-08-2014 07:18 PM
I realized that I hadn't checked the sample apps, and there is in fact a "messages" sample app that appears to work.