# Request.env availability

**URL:** <https://www.ruby-forum.com/t/request-env-availability/107008>\
**Category:** Rails\
**Created:** [June 16, 2007, 3:13pm UTC](https://www.ruby-forum.com/t/request-env-availability/107008 "2007-06-16T15:13:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![surge](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/4da419/32.png) [@surge](https://www.ruby-forum.com/u/surge)\
**Post date:** [June 16, 2007, 3:13pm UTC](https://www.ruby-forum.com/t/request-env-availability/107008/1 "2007-06-16T15:13:37Z")

</div>

Hello everybody,

My application will run on different machines with different host  
names. In most of my emails I have to include a link with the name of  
the server the email is coming from. So, I decided to use the  
request.env hash to get the server name. But request.env is not  
available in ActionMailer. So, I have to pass that variable to each  
mailing method from the controller, which doesn’t look too good.

Is there a better way? Can I hardcode the name of the server somewhere  
in the configuration (environment.rb ?) and thus make it available  
everywhere?

Thanks,  
Sergei
