Search code examples
qtqt-mobility

QT Mobility - Nokia QT SDK


I want to send the email from my QTSimulator. I am using the following code for send the email.

    QMessage msg;
    msg.setType(QMessage::Email);

    // Set recipient for our email message
    QString recipient("[email protected]");
    msg.setTo(QMessageAddress(QMessageAddress::Email, recipient));

    // Define message subject, body and append attachment
    msg.setSubject("Messaging API example");
    msg.setBody("Hello,\n\nthis is an example message.");

    // Send message using a new service handle
    QMessageService* svc = new QMessageService();

    if (svc->send(msg))
        qDebug("Successfully sent message.");
    else
        qWarning("Failed to send message.");

But I got the following error...
"Invalid message account ID
Failed to send message."

Please help me.. Thanks is advance.

Is it possible to send mail from QT-Simulator? Can we do any configuration for network connectivity?


Solution

  • As far as I know this isn't possible. Qt simulator only has feature to simulate incoming messages so you can test how your app handles them.