Is it possible to reply to automatically an incoming email with, say,
a key word in the subject line....with my current outside IP address?
I'm assuming you are behind a router/firewall doing NAT? Your system has no
way to determine the outside IP that your router has mapped to your
private/non-routable/inside IP, it only knows the inside IP, and its gateway
IP. The router takes it from there. Source and destination IP addresses in
each frame are translated by the router, and each frame is altered
accordingly, before its seen by your system TCP/IP stack.
You might be able to trace the route, and infer it as the first non-RFC1918
address in the route, but that may not be accurate, your router could use a
pool of public IPs, there'd be no guarantee. Also, many router/firewall
appliances do not respond to ICMP queries, in which case you'd get the IP of
some upstream router based on that inference.
So unless it's a static mapping and you don't mind obtaining it from the
user and storing it as a config, the answer would be no, probably not.
-Mark