View Full Version : QTMobility API

22nd October 2010, 10:59

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

QMessage msg;

// 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.");
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?

22nd October 2010, 11:11
No, I don't think this is possible.

22nd October 2010, 11:18
Ok Thanks.. Then How can I solve this ? Please assist me.. I want to check the program is working or not..

22nd October 2010, 11:29
Deploy it on a real device or on a system that supports the messaging framework.

22nd October 2010, 12:12

Thanks ...........

how to make the system that supports the messaging framework ?
Currently I am using the windows-7 and nokia qt sdk 1.1.0 version.

Please help me. Thanks in advance

22nd October 2010, 12:29
I'm just looking at your code... and I think it is incorrect. You can't create a standalone message with a standalone message service and expect it to work. How should the framework know what is the sender's address or which servers to use to transfer the messages? You probably need to use QMessageManager, QMessageAccount and family. Look at the "Service Actions" example for more details.

23rd October 2010, 06:42
Thank u very much. I am started to work on that..