# Re: ActionMailer 2.0.2 NameError

**URL:** <https://www.ruby-forum.com/t/re-actionmailer-2-0-2-nameerror/132388>\
**Category:** Rails\
**Created:** [March 19, 2008, 5:04pm UTC](https://www.ruby-forum.com/t/re-actionmailer-2-0-2-nameerror/132388 "2008-03-19T17:04:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ziggah](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/779978/32.png) [@Ziggah](https://www.ruby-forum.com/u/Ziggah)\
**Post date:** [March 19, 2008, 5:04pm UTC](https://www.ruby-forum.com/t/re-actionmailer-2-0-2-nameerror/132388/1 "2008-03-19T17:04:32Z")

</div>

Jonathon Davis-2 wrote:

> ```
> :address => "my.server.address.com",
> 
> ```
> 
> C:/ruby/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active\_support/  
> from C:/InstantRails/rails\_apps/rails\_space/config/  
> from C:/ruby/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:  
> 27:in `gem_original_require' from C:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb: 27:in `require’  
> from script/server:3  
> Any assistance would be greatly appreciated.

Hey guys, I had this problem as well, I searched around a bit in the  
base.rb(X:\ruby\libs\ruby\gems\1.8\gems\actionmailer-2.0.2\lib\action\_mailer\base.rb)  
and found the problem(for me anyhow). Instead of  
“ActionMailer::Base.server\_settings = { … ect …” they have it defined  
as  
“ActionMailer::Base.smtp\_settings = { … ect …” to define our smtp  
servers  
parameters.

Taken directly from base.rb:

# \* smtp\_settings - Allows detailed configuration for :smtp

delivery method:

# \* :address Allows you to use a remote mail server. Just

change it from its default “localhost” setting.

# \* :port On the off chance that your mail server doesn’t

run  
on port 25, you can change it.

# \* :domain If you need to specify a HELO domain, you can

do it  
here.

# \* :user\_name If your mail server requires authentication,

set  
the username in this setting.

# \* :password If your mail server requires authentication,

set  
the password in this setting.

# \* :authentication If your mail server requires

authentication, you need to specify the authentication type here.

As for where to place it definitely create it it’s own file in the  
initializers directory with your connection info, and not at the end of  
the  
environment.rb (\yourapp\config\initializers\action\_mailer.rb)

Here is what the file(action\_mailer.rb) should look like:

ActionMailer::Base.delivery\_method = :smtp  
ActionMailer::Base.smtp\_settings = {  
:address =\> “localhost”, # or an external ip if your using a remote  
smtp  
:port =\> 25,  
:domain =\> “domainnamehere”,  
:authentication =\> :login,  
:user\_name =\> “username here”,  
:password =\> “passwordhere”  
}

Cheers, Ziggah

–  
View this message in context:  
[http://www.nabble.com/ActionMailer-2.0.2-NameError-tp15763436p16145138.html](http://www.nabble.com/ActionMailer-2.0.2-NameError-tp15763436p16145138.html)  
Sent from the RubyOnRails Users mailing list archive at [Nabble.com](http://Nabble.com).
