Friday, May 21, 2010

C programming question?

I've just started C programming and how can I make a program to trace the ip of the receiver of the packets/data that I send across the internet? For example, I open the program and send an email and the program traces the data and gives me the receiver ip.

C programming question?
You really can't do what you say you want to do. When you send an email, it goes first to your ISP's mail server, then from there to the recipient's mail server. Later, when they pick up the email from their ISP, there's no way for you to know what IP address they're using to retrieve the email.
Reply:If you are writing an email client, you can get the ip of your smtp mailserver.





If you want the ip of the recipient's mail server you do:


host -t mx domain (note the hostname)


and then host hostname





See the link for how to resolve a hostname in C


No comments:

Post a Comment