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
Posts: 75
Registered: ‎11-30-2012
My Device: curve
My Carrier: airtel

launching the email composer with an email-id

Hello,

 

I am able to launch an email composer using the invokeframework.

I want to launch the composer with a predefined email-id.

 

how to do it.

 

-thanks

Developer
Posts: 313
Registered: ‎05-31-2010
My Device: Alpha 10, Bold 9900, Storm 9530, Tour 9630, Curve 9320, Curve 8900
My Carrier: All

Re: launching the email composer with an email-id

You can use MessageService

 

Please refer with the sample application Messages to find out this part

void MessageComposer::loadMessage(MessageKey messageId)
{
    Q_ASSERT(m_accountId != -1);

    m_messageId = messageId;

    // Fetch new values from persistent storage
    const Message message = m_messageService->message(m_accountId, m_messageId);

    m_subject = message.subject();
    m_recipient = message.sender().address();
    m_body = message.body(MessageBody::PlainText).plainText();
    if (m_body.isEmpty())
        m_body = message.body(MessageBody::Html).plainText();

    // Adapt message to be a reply
    m_subject = QString::fromLatin1("Re: %1").arg(m_subject);
    m_body.replace("\n", "\n> ");
    m_body = QString::fromLatin1("> %1").arg(m_body);

    emit subjectChanged();
    emit recipientChanged();
    emit bodyChanged();
}

 




p(^_^)q
Good good study, day day up
Regular Contributor
Posts: 75
Registered: ‎11-30-2012
My Device: curve
My Carrier: airtel

Re: launching the email composer with an email-id

Thanks for the response.

 

Seems we can set the uri with "mailto" option to prepopulate the to/cc/bcc field.

 

-thanks