# Mailer class error

**URL:** <https://www.ruby-forum.com/t/mailer-class-error/103355>\
**Category:** Rails\
**Created:** [May 4, 2007, 5:05pm UTC](https://www.ruby-forum.com/t/mailer-class-error/103355 "2007-05-04T17:05:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![BensPop](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/ecb155/32.png) [@BensPop](https://www.ruby-forum.com/u/BensPop)\
**Post date:** [May 4, 2007, 5:05pm UTC](https://www.ruby-forum.com/t/mailer-class-error/103355/1 "2007-05-04T17:05:52Z")

</div>

I created a helper method in a file called mailer\_helper.rb that I  
want to use in my mailer class. I included the helper using this  
statement:  
helper :mailer  
even after including this I get this error:  
undefined local variable or method `get\_host’ for #Mailer:0x38aca0c  
any ideas?

class Mailer \< ActionMailer::Base

helper :mailer

def contact\_us(contact\_us)  
@subject = ‘Nu+riSum contact request’  
@recipients = ‘removed\_email\_address@domain.invalid’  
@from = contact\_us.email  
@sent\_on = Time.now  
@layout = :mailer  
@body =  
{  
:fn =\> contact\_us.first\_name,  
:ln =\> contact\_us.last\_name,  
:em =\> contact\_us.email,  
:org =\> contact\_us.organization,  
:ph =\> contact\_us.phone,  
:msg =\> contact\_us.comments,  
:host =\> get\_host  
}  
end
