PDA

View Full Version : QTMobility API



Girija
22nd October 2010, 10:59
Hi,

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?

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

Girija
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..

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

Girija
22nd October 2010, 12:12
hi,

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

wysota
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.

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