Actionmailer sends from commandline but not from web

Hello all,

I’m having trouble with this simple email class I made for postbacks.
When I run this from the command line an email is sent, however when I
access this .rb file through a browser nothing happens.


#!/usr/bin/ruby
require “rubygems”
require “action_mailer”

ActionMailer::Base.delivery_method = :smtp

ActionMailer::Base.smtp_settings = {
:address => “smtp.domain.com”,
:port => “25”,
:domain => “domain.com
}

class Emailer < ActionMailer::Base
def test()
recipients “[email protected]
from “[email protected]
subject “subject”
body “body”
end
end

Emailer.deliver_test()

I’m running Apache 2.2, and this is what my ruby.conf file for it looks
like:


LoadModule ruby_module modules/mod_ruby.so

RubyRequire apache/ruby-run RubyRequire apache/eruby-run

<Files *.rb>
SetHandler ruby-object
RubyHandler Apache::RubyRun.instance

<Files *.erb>
SetHandler ruby-object
RubyHandler Apache::ERubyRun.instance

ExecCGI in enabled as well.

Any ideas?

Fixed.

It was an SELinux issue. I googled around after looking in Apache’s
error log, I had to allow HTTP scripts to contact the network.

Dave