views:

35

answers:

3

You can choose any language. I am interested to know the simplest solution. How can you get your comp's IP and email it?

+3  A: 

Linux bash command line:

/sbin/ifconfig eth0 | grep 'inet addr' | cut -d: -f2 | cut -d ' ' -f1 | mail -s 'My IP address' [email protected]
unwind
+2  A: 

Awk alternative to unwind's solution:

ifconfig eth0 | grep 'inet addr' | awk -F: '{print $2}' | awk -F' ' '{print $1}' | mail -s "My IP address" [email protected]
Masi
A: 

there is a website doing this. it will send the ip address to the email address you type in. http://mmmip.com

code90