# ActionMailer Confusion

**URL:** <https://www.ruby-forum.com/t/actionmailer-confusion/188271>\
**Category:** Rails\
**Created:** [May 9, 2010, 12:01am UTC](https://www.ruby-forum.com/t/actionmailer-confusion/188271 "2010-05-09T00:01:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![djames](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/7ab992/32.png) [@djames](https://www.ruby-forum.com/u/djames)\
**Post date:** [May 9, 2010, 12:01am UTC](https://www.ruby-forum.com/t/actionmailer-confusion/188271/1 "2010-05-09T00:01:15Z")

</div>

I am running Rails 2.3.2.

I had something like the following in my environment.rb file:

ActionMailer::Base.delivery\_method=:smtp  
ActionMailer::Base.server\_settings={ :whatever }

Strangely, everything seemed to work just fine. Then Rails started  
complaining about my environment. Specifically, it complained that  
ActionMailer::Base did not have a server\_settings method. A little  
Googling revealed that apparently things had gotten changed and that  
now I was supposed to use:

config.action\_mailer.delivery\_method = :smtp  
config.action\_mailer.smtp\_settings = { :whatever }

Now I’m getting complaints that there is no local variable or method,  
‘config’.

Can someone please tell me how to correctly make this configuration in  
my version of Rails? As I say, I have no idea how it ever worked. If  
anyone has any thoughts on that, I’d love to hear them as well. TIA.

```
        ... doug
```

---

<div class="post-metadata">

**Author:** ![djames](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/7ab992/32.png) [@djames](https://www.ruby-forum.com/u/djames)\
**Post date:** [May 9, 2010, 3:25am UTC](https://www.ruby-forum.com/t/actionmailer-confusion/188271/2 "2010-05-09T03:25:35Z")

</div>

I got this issue resolved and I thought I would mention what the  
solution was in case someone else encounters this situation. In  
retrospect, it was a rather stupid error on my part. When I appended  
the following 2 lines to my environment.rb file:

config.action\_mailer.delivery\_method = :smtp  
config.action\_mailer.smtp\_settings = { :whatever }

I did just that, I appended them. They should rather be INSERTED  
before the concluding ‘end’. Sorry for the noise on this issue.

```
       ... doug
```
