# Problems getting ActionMailer working (on server)

**URL:** <https://www.ruby-forum.com/t/problems-getting-actionmailer-working-on-server/56623>\
**Category:** Rails\
**Created:** [April 1, 2006, 9:47pm UTC](https://www.ruby-forum.com/t/problems-getting-actionmailer-working-on-server/56623 "2006-04-01T21:47:13Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dracos](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ea666f/32.png) [@dracos](https://www.ruby-forum.com/u/dracos)\
**Post date:** [April 1, 2006, 9:47pm UTC](https://www.ruby-forum.com/t/problems-getting-actionmailer-working-on-server/56623/1 "2006-04-01T21:47:13Z")

</div>

Hi,

I’ve read the Agile Rails book’s chapter on ActionMailer a few times.  
Seems pretty straight forward. Unfortunately I can’t get my  
application to actually send mail.

I uploaded my application to the web server and tried to get a mail  
message sent. Nothing happened. I looked in the log file and it says

Sent mail:  
From: removed\_email\_address@domain.invalid  
To: removed\_email\_address@domain.invalid  
Bcc: removed\_email\_address@domain.invalid  
Subject: Freedom Kilts Order Confirmation  
Content-Type: text/plain; charset=utf-8

and I don’t see any errors. Does this mean that the rails app was  
happy and able to connect to the mail server?

In my configuration.rb file I have (where password is actually visible  
and correct). I am able to log into the webmail with this username and  
password so I think that part is ok. I also tried without the “mail.”  
part in :domain.

ActionMailer::Base.delivery\_method = :stmp

ActionMailer::Base.server\_settings = {  
:address =\> “[mail.freedomkilts.com](http://mail.freedomkilts.com)”,  
:port =\> 25,  
:domain =\> “[mail.freedomkilts.com](http://mail.freedomkilts.com)”,  
:authentication =\> :login,  
:user\_name =\> “removed\_email\_address@domain.invalid”,  
:password =\> “\*\*\*\*\*\*\*\*”  
}

ActionMailer::Base.default\_charset = “utf-8”

When I use the create\_order() method and look at the generated email  
everything looks ok. I have switched this to deliver\_order().

Any ideas? Getting ActionMailer working has been a much too long project  
for me.

Thanks,  
Peter

---

<div class="post-metadata">

**Author:** ![dracos](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ea666f/32.png) [@dracos](https://www.ruby-forum.com/u/dracos)\
**Post date:** [April 1, 2006, 9:53pm UTC](https://www.ruby-forum.com/t/problems-getting-actionmailer-working-on-server/56623/2 "2006-04-01T21:53:20Z")

</div>

In case it matters, I don’t know how to restart my rails app on the  
monsterhosting.ca webserver since I never had to start it in the first  
place. It just seems to run. So I don’t even know if my environment  
changes are taking affect when I make them.

Thanks,  
Peter

---

<div class="post-metadata">

**Author:** ![dracos](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ea666f/32.png) [@dracos](https://www.ruby-forum.com/u/dracos)\
**Post date:** [April 2, 2006, 5:32am UTC](https://www.ruby-forum.com/t/problems-getting-actionmailer-working-on-server/56623/3 "2006-04-02T05:32:28Z")

</div>

Anyone have any ideas? I’ve been struggling with this email problem for  
hours.  
Thanks,  
Peter

---

<div class="post-metadata">

**Author:** ![dracos](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ea666f/32.png) [@dracos](https://www.ruby-forum.com/u/dracos)\
**Post date:** [April 2, 2006, 6:24am UTC](https://www.ruby-forum.com/t/problems-getting-actionmailer-working-on-server/56623/4 "2006-04-02T06:24:07Z")

</div>

Hi Ray,

Thank you for the information. I am amazed this is such a difficult  
problem. In PHP all I need to do is something little like

mail($content, $to, $from)

I’ll keep trying.

Thanks,  
Peter

---

<div class="post-metadata">

**Author:** ![dracos](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ea666f/32.png) [@dracos](https://www.ruby-forum.com/u/dracos)\
**Post date:** [April 2, 2006, 6:11am UTC](https://www.ruby-forum.com/t/problems-getting-actionmailer-working-on-server/56623/5 "2006-04-02T06:11:53Z")

</div>

Peter M. wrote:

> Anyone have any ideas? I’ve been struggling with this email problem for hours.

There are so many mail configurations that this is hard problem to solve  
with the provided information. It’s also pretty hard to solve this type  
of problem without shell access, and that you don’t even know if your  
config changes are being entered makes it a bear.

1. Try to figure out how to make config changes take effect. See if you  
can access the server logs. Double check the docs your host provides. If  
you don’t know if the changes are applied, you are wasting your time. If  
your host is not helpful, just upload a broken config file and see if  
that breaks your app. Be ready to roll it back.

Once that is clear,

1. Are you sure the delivery method is smtp?

2. Since you are sending mail from the host, you aren’t using  
authentication, comment out that line, and the password.

3. The user\_name that you configure will be the sender of the mail.  
Depending on how things are configured, and where the error is, the mail  
might be returned to that address. Is that address a mail box where you  
can read the mail.

4. Are you sure you don’t have access to the server logs? What about the  
mail logs?

–

Ray
