actionmailer - how to access request.env

i need to access the host name (and probably the port) inside
actionmailer.

i need to send a link to something in the public/images directory.

in any normal page, i can access this via the request.env variable, but
it looks like this variable is not defined in actionmailer..

what i would like to do is have it send the correct link via email, no
matter what server i run it from (my development machine, the test
server, or the production server).

so on the my development server, it would spit out:

http://localhost:3000/images/logo.gif

on the test server, it would spit out:

http://www.<testdomain>:3000/images/logo.gif

and on the live one, it would spit out:

http://www.<liveserver>.com/images/logo.gif

any ideas?

thanks!

just in case anyone is running into this same problem, i did a quick and
dirty solution on this one..

i ended up sending request.host and request.port along with the function
call..

i know.. it's ugly.. but for right now, it works..