IwantToLearen
13th February 2013, 15:48
Hi,
I am trying to send an email using gmail or yahoo ..etc.
I was looking into this (URL="http://www.qtcentre.org/threads/2221-Sending-email-using-Qt) 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 (http://email.about.com/od/accessinggmail/f/Gmail_SMTP_Settings.htm) 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 (http://www.qtcentre.org/members/1605-patrik08) in this thread (http://www.qtcentre.org/threads/2221-Sending-email-using-Qt) 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.
connect(smtpSocket,SIGNAL(connected()),this,SLOT(s mtpConnected()))
connect(smtpSocket,SIGNAL(error(QAbstractSocket::S ocketError)),this,SLOT(smtpError(QAbstractSocket:: SocketError)))
....
....
smtpSocket->connectToHost("smtp.gmail.com",465) // I also tried port 25 as in the original code but it failes to.
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{8712}, so if anyone would like to test and try it.
Thanks
I am trying to send an email using gmail or yahoo ..etc.
I was looking into this (URL="http://www.qtcentre.org/threads/2221-Sending-email-using-Qt) 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 (http://email.about.com/od/accessinggmail/f/Gmail_SMTP_Settings.htm) 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 (http://www.qtcentre.org/members/1605-patrik08) in this thread (http://www.qtcentre.org/threads/2221-Sending-email-using-Qt) 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.
connect(smtpSocket,SIGNAL(connected()),this,SLOT(s mtpConnected()))
connect(smtpSocket,SIGNAL(error(QAbstractSocket::S ocketError)),this,SLOT(smtpError(QAbstractSocket:: SocketError)))
....
....
smtpSocket->connectToHost("smtp.gmail.com",465) // I also tried port 25 as in the original code but it failes to.
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{8712}, so if anyone would like to test and try it.
Thanks