Frage
Ich mag die E-Mail von meinem QTSimulator senden. Ich verwende den folgenden Code für die E-Mail senden.
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.");
Aber ich habe die folgende Fehlermeldung ...
„Ungültige Nachrichten-Konto-ID
Nachricht kann nicht gesendet werden. "
Bitte helfen Sie mir .. Danke voraus ist.
Ist es möglich, E-Mails von QT-Simulator zu schicken? Können wir jede Konfiguration für Netzwerk-Konnektivität zu tun?
Lösung
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.
Andere Tipps
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).