Question

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("xxxxx@gmail.com");
    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?

Was it helpful?

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.

OTHER TIPS

Once I had qt mobility with messaging compiled on my own (under windows), so it was intergrated with ms outlook. Once email was received by Outlook, messaging sent notification. I guess this would work in an opposite direction. This worked in Qt Simulator as well (but button responsible for simulating new message was not working).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top