×

Discussion Board

Results 1 to 8 of 8

Hybrid View

  1. #1
    Registered User
    Join Date
    May 2010
    Posts
    1

    Sending Email Using Qt Mobility

    Hi All

    The "writemesaage" example given with QT-Mobility, shows how to send messages of different types using 'QT Mobility Messaging'. But running this example on the device provides only two options, SMS and MMS even though email is also supported by the available accounts. What do i need to change in order to send an message of type Email?

    The type of the message being sent is assigned as QMessage::Email.

  2. #2
    Registered User
    Join Date
    May 2011
    Posts
    9

    Re: Sending Email Using Qt Mobility

    have you save the problem?
    I write a sending Email program with Qt Mobility,but it doesn't work on N900 which is Maemo platforn. It suggest that Account ID is invalid.
    there are my key codes,please help me! Thank you!

    void dialog2::SendEmail(){

    QMessageService *messageService=new QMessageService;

    // Create a new email
    QMessage msg;
    msg.setType(QMessage::Email);
    msg.setParentAccountId(QMessageAccount::defaultAccount(QMessage::Email));
    // Add required parameters
    msg.setTo (QMessageAddress(QMessageAddress::Email,"zhangbo1417@gmail.com"));
    msg.setBody(EmailBody);
    msg.setSubject("SMS Backup");

    //Send email message
    if(messageService->send(msg)){
    QMessageBox::information(0,tr("Success"),tr("Email sent successfully!"));
    hide();
    }
    else QMessageBox::warning(0,tr("Failed"),tr("Unable to send Email!"));
    }

  3. #3
    Registered User
    Join Date
    Dec 2007
    Posts
    104

    Re: Sending Email Using Qt Mobility

    Hi zhangbo1417,

    I used the same code. In simulator send() returns true, whereas in device it returs false. Have anyone managed to send Email successfully with this code ?

  4. #4
    Registered User
    Join Date
    Sep 2011
    Posts
    449

    Re: Sending Email Using Qt Mobility

    Hi,

    Seems its failing here - msg.setParentAccountId(QMessageAccount::defaultAccount(QMessage::Email));
    should check an alternate for this..

  5. #5
    Registered User
    Join Date
    Dec 2007
    Posts
    104

    Re: Sending Email Using Qt Mobility

    Hi,

    I felt setting parent account id is not needed as the documentation says,

    bool QMessageService::send ( QMessage & message )

    Transmit message using the account identified by the message's parentAccountId function. If the message does not have a valid parentAccountId, it will be set to the result of QMessageAccount::defaultAccount() for the message's type.


    So, it fails in send() for me.

  6. #6
    Registered User
    Join Date
    Sep 2011
    Posts
    449

    Re: Sending Email Using Qt Mobility

    Hi,

    Ok. When i explicitly use setParentAccountId with the defaultAccount as param, its returning error saying that cannot find default account.

    So, as per documentation if the same call is being made internally, it will fail.
    Basically this is not working - QMessageAccount::defaultAccount(QMessage::Email) whether we use it explicitly or the send api internally calls it.

  7. #7
    Registered User
    Join Date
    Dec 2007
    Posts
    104

    Re: Sending Email Using Qt Mobility

    Are you sure you have configured any email account with mail application ?? I am using E7 and configured my Gmail account in there.

  8. #8
    Registered User
    Join Date
    Sep 2011
    Posts
    449

    Re: Sending Email Using Qt Mobility

    Yes, I have configured gmail using mail application. I used N9

Similar Threads

  1. Able to send MMS but not SMS using Qt Mobility Messenger
    By Zedster in forum [Archived] Qt Mobility Project
    Replies: 10
    Last Post: 2010-12-16, 12:16
  2. automatic rotate screen on meamo
    By fily_love in forum Nokia N9
    Replies: 27
    Last Post: 2010-04-06, 08:37
  3. Sending email using default application of Device
    By yatin_indianic in forum Mobile Java General
    Replies: 0
    Last Post: 2010-03-11, 13:55
  4. Sending email from E61 S60 3rd edition phone
    By waynej2 in forum Mobile Java General
    Replies: 1
    Last Post: 2007-09-13, 21:18

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×