Click to See Complete Forum and Search --> : Unable to resolve IP address


Jacko123
July 4th, 2007, 05:36 AM
Hi guys,
I'm trying to send an email using Qt.

Here is what I did..
1) Created an interface accept "To:, From:, Subject:, and body" from user
2) create a socket "socket"
3) create DNS with Mx( Mail exchanger )
4) get the host server name from DNS
5) make a connection to host (specified in To: )on the specified port which is 25 for SMTP
6) if connection is successful, transmit the message.

Now the problem is the server is refusing to connect.
Here is the example:
From: xyz@gmail.com
To: 123@yahoo.com
gmail.com is unable to connect to yahoo.com...I dont know why??

Can someone please tell me what might be the reason for connection refused?
One more thing I'm in an intranet.. Is there anything I need to bypass to make connection work properly. I'm sure there is no problem with my code. Can someone please help me....

Thanks

Krishnaa
July 4th, 2007, 05:41 AM
Have you used right SMTP port ?

Jacko123
July 4th, 2007, 05:47 AM
Have you used right SMTP port ?
Yes, The port is 25

Krishnaa
July 4th, 2007, 06:10 AM
Okay, thats the right port, I was not sure of it...

BTW have you specified that the server requires SSL ??

Jacko123
July 4th, 2007, 07:06 AM
Okay, thats the right port, I was not sure of it...

BTW have you specified that the server requires SSL ??
Ok.. I got know something here when I type
> telnet gmail-smtp-in.l.google.com 25
I get this below message
Trying 209.85.147.27...
telnet: connect to address 209.85.147.27: No route to host
Trying 209.85.147.114...
telnet: connect to address 209.85.147.114: No route to host

How to correct the above problem.

Krishnaa
July 4th, 2007, 07:51 AM
Ok.. I got know something here when I type
> telnet gmail-smtp-in.l.google.com 25
I get this below message
Trying 209.85.147.27...
telnet: connect to address 209.85.147.27: No route to host
Trying 209.85.147.114...
telnet: connect to address 209.85.147.114: No route to host

How to correct the above problem.

Well, I am not a QT expert, but if it allows you to send mails then it must have the way to specify SSL for connections. GMAIL has documented it in here,

http://mail.google.com/support/bin/answer.py?ctx=%67mail&hl=en&answer=12103

Jacko123
July 4th, 2007, 07:58 AM
Well, I am not a QT expert, but if it allows you to send mails then it must have the way to specify SSL for connections. GMAIL has documented it in here,

http://mail.google.com/support/bin/answer.py?ctx=%67mail&hl=en&answer=12103

But what is the relation between "Qt" and "SSL for connection". And let me tell you, the problem is not at all related to Qt but with connection. I have done telnet on terminal not using Qt program. I want to know, when I telnet to gmail, I get "No route to host" error. Why????

If you are on linux type this on the terminal
telnet gmail-smtp-in.l.google.com 25 and let me know what is that you are getting the response. I think in that way we can solve the problem.

Thanks

MikeAThon
July 4th, 2007, 12:40 PM
Ok.. I got know something here when I type
> telnet gmail-smtp-in.l.google.com 25
I get this below message
Trying 209.85.147.27...
telnet: connect to address 209.85.147.27: No route to host
Trying 209.85.147.114...
telnet: connect to address 209.85.147.114: No route to host

How to correct the above problem.
DNS is working, since you were able to resolve "gmail-smtp-in.l.google.com" into two different IP addresses.

But the gmail server is not allowing telnet to connect to port 25.

This does not seem surprising, for the reason that you are not following any of the SMTP protocols.

Try using Andreas Masur's simple console program for sending e-mail (at http://www.codeguru.com/forum/showthread.php?t=300530 )

You can also try this class: http://www.naughter.com/smtp.html

Mike

Jacko123
July 4th, 2007, 11:38 PM
Hi,
I think there is so much confusion. There is no problem with my code. The only problem i can see is my network admin has blocked and mail sites (yahoo, gmail ) etc. He says I can only use 198.168.1.1 IP to send and receive the mails.
How can I bypass my intranet to all my application send mails.

Thanks

MikeAThon
July 5th, 2007, 11:56 AM
Ask your admin more nicely.

henky@nok.co.id
July 10th, 2007, 02:35 AM
Usually net-admin will block all ports to internet conection except HTTP
and SSL for security reasons. You can imagine if your network opens
SMTP port for all computer and there is a program in one of computer
that send email to millions of email users (spam-mail). Your network can
be crash.

To test your program, just use internal mail server.