0

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

Léo Léopold Hertz 준영
  • 134,464
  • 179
  • 445
  • 697

3 Answers3

3

Linux bash command line:

/sbin/ifconfig eth0 | grep 'inet addr' | cut -d: -f2 | cut -d ' ' -f1 | mail -s 'My IP address' someone@example.com
unwind
  • 391,730
  • 64
  • 469
  • 606
2

Awk alternative to unwind's solution:

ifconfig eth0 | grep 'inet addr' | awk -F: '{print $2}' | awk -F' ' '{print $1}' | mail -s "My IP address" some@email.com
Léo Léopold Hertz 준영
  • 134,464
  • 179
  • 445
  • 697
0

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

code90
  • 718
  • 9
  • 22