How to find out the hosting server’s outbound IP address

ipshared-hosting

I need to find out my web hosting server's IP address. Its on a shared hosting server and from experience, it's usually not the same as the incoming IP address that you would get by just pinging the domain name. Is there a php script I can run or something to find our the outbound IP address my website is using when connecting to a SMTP server for example?

Best Answer

I have success when I try

curl -s ip.appspot.com

Or with PHP:

<?php
echo file_get_contents("http://ip.appspot.com");
?>