Cannot send e-mail on Symbian (Belle Refresh)
Hello!
I'm trying to send e-mail using Qt Mobility 1.2, but it's not working and i dunno what's happening.
When a call send method from QMessageService, it returns false and the error is 8 (QMessageManager::RequestIncomplete).
The message i'm trying to send is:
QMessageAddress objFrom;
objFrom.setType(QMessageAddress::Email);
QMessageAddress objTo;
objTo.setType(QMessageAddress::Email);
objTo.setAddressee("email@email.com"); //removed to post here
QMessage msg;
msg.setType(QMessage::Email);
msg.setTo(objTo);
msg.setPriority(QMessage::NormalPriority);
msg.setSubject(item->getSubjectEmail());
msg.setBody(mensagem, "text/plain");
msg.setDate(QDateTime::currentDateTime());
QMessageAccountId conta = this->IdContaEmail(contaEmail); //returns the AccountId for a given e-mail. I've tested and it's returning a valid account
msg.setParentAccountId(conta);
if (!_servicoEmail->send(msg))
qDebug() << "Failed to send e-mail" << _servicoEmail->error();
The IdContaEmail method:
QMessageAccountId CEmail::IdContaEmail(const QString &email)
{
QMessageManager man;
QMessageAccountIdList lst = man.queryAccounts();
for (int i = 0; i < lst.count(); i++) {
QMessageAccount conta(lst.at(i));
if (conta.name() == email) {
return lst.at(i);
}
}
return QMessageAccountId();
}
Any help would be appreciated.
Thank you.
Re: Cannot send e-mail on Symbian (Belle Refresh)
I think you have msg.setFrom() missing.
Re: Cannot send e-mail on Symbian (Belle Refresh)
I have used this in tests, but gives me the same error...
Even complete examples don't work. Would be a configuration on my phone or something that i'm missing?
Thank you
Re: Cannot send e-mail on Symbian (Belle Refresh)
I'm still with no solution. I've tried a lot of ways go do this, but always ends with the same error when send() is called...
Re: Cannot send e-mail on Symbian (Belle Refresh)
I've fixed the issue. It was capabilities.
Thank you.