Closed vikasgrao2 closed 2 years ago
Late for the party but it might help others: I was tricked by the same issue by the company proxy.
smtpClient.getSocket()->setProxy(QNetworkProxy::NoProxy);
did the trick for me. This was revealed rather quickly after adding some oputput to the socket error handler:
void SmtpClient::socketError(QAbstractSocket::SocketError socketError)
{
qWarning()<<"Socket Error: "<
HTH!
Having the access to the smtp server from the internal network, it was not able to connect to the server, and the connectToHost() was returning false with an error code of ConnectionTimeoutError.
The return was from the below snippet if (!socket->waitForConnected(connectionTimeout)) { emit smtpError(ConnectionTimeoutError); return false; }
Tried with all type of Connections, Tcp, SSL and TLS. The same was able to connect to other smtp servers like gmail, yahoo etc. Also, the smtp server that is getting connection time out, is able to be telnet from the system.
Is there anything that is missing out ?