Actionmailer - how to access request.env

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

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:


on the test server, it would spit out:


and on the live one, it would spit out:

any ideas?


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

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

i know… it’s ugly… but for right now, it works…