Hi I'm trying to send Email from my qt-app.
I'm using the MailSender class. Source code can be found here:
http://forum.qtfr.org/viewtopic.php?id=7736
The class is discussed here from post #9 and downwards:
http://www.qtforum.org/article/26688...-with-qt4.html
The example client code provided in the thread doesn't seem right (and doesn't work) so this is what I use:
{
qDebug() << "initializing Emailing...";
MailSender test
("smtp.googlemail.com",
"myname@gmail.com",
QStringList("kristofer.johansson@tkoprototyping.com"),
"ett",
"två");
test.setSubject("Test2"),
test.setBody("Ångström");
test.setLogin("myname@gmail.com", "password");
test.setSsl(true);
test.setPort(465);
test.setPriority(MailSender::high);
if(test.send()) {
qDebug() << "mail sent";
}
else {
qDebug() << "failed to send mail";
qDebug() << test.lastError() << test.lastCmd() << test.lastResponse();
}
{
qDebug() << "initializing Emailing...";
MailSender test("smtp.googlemail.com", "myname@gmail.com", QStringList("kristofer.johansson@tkoprototyping.com"), "ett", "två");
test.setSubject("Test2"),
test.setBody("Ångström");
test.setLogin("myname@gmail.com", "password");
test.setSsl(true);
test.setPort(465);
test.setPriority(MailSender::high);
if(test.send()) {
qDebug() << "mail sent";
}
else {
qDebug() << "failed to send mail";
qDebug() << test.lastError() << test.lastCmd() << test.lastResponse();
}
To copy to clipboard, switch view to plain text mode
And this only results in a timeout error "Read timeout".
Any ideas on why that might be or an alternate setting/solution?
/Tottish
Bookmarks