Forum: Ruby on Rails problems getting ActionMailer working (on server)

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Peter M. (Guest)
on 2006-04-01 23:47
(Received via mailing list)

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   => "",
  :port      => 25,
  :domain    => "",
  :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.

Peter M. (Guest)
on 2006-04-01 23:53
(Received via mailing list)
In case it matters, I don't know how to restart my rails app on the 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.

Peter M. (Guest)
on 2006-04-02 07:32
(Received via mailing list)
Anyone have any ideas? I've been struggling with this email problem for
Ray B. (Guest)
on 2006-04-02 08:11
(Received via mailing list)
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,

2) Are you sure the delivery method is smtp?

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

4) 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.

5) Are you sure you don't have access to the server logs? What about the
  mail logs?


Peter M. (Guest)
on 2006-04-02 08:24
(Received via mailing list)
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.

This topic is locked and can not be replied to.