Hi,
I am trying to send an email using gmail or yahoo ..etc.
I was looking into this thread
The issue i am facing is, when i try to connect to smtp.gmail.com, the connection fails. and the HostNotFoundError is thrown.

The smtp server name for gmail i got it from this website, here it says that

server address :smtp.gmail.com
port : 465
TLS/SSL required: yes, which i did not understand, what exactly i have to do for this case.

The code i am using is the code written by patrik08 in this thread post #9, I also made the edit that was mentioned in post #11.

so right now,I'm not able to get the connection to be successful.
Qt Code:
  1. connect(smtpSocket,SIGNAL(connected()),this,SLOT(smtpConnected()))
  2. connect(smtpSocket,SIGNAL(error(QAbstractSocket::SocketError)),this,SLOT(smtpError(QAbstractSocket::SocketError)))
  3. ....
  4. ....
  5. smtpSocket->connectToHost("smtp.gmail.com",465) // I also tried port 25 as in the original code but it failes to.
To copy to clipboard, switch view to plain text mode 
Please if any one can help me with this I would really appreciate it.

BTW: the reason for making new thread, because i asked there and no one reply, as the thread really old and has too many replies so it seems no one is interested to reply , as well it maybe i am asking a noob questions, so I though maybe someone here will be welling to help me.


I made a compiled version with GUI interface to use the SMTP class{Send_Email.tar.gz}, so if anyone would like to test and try it.

Thanks