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.

require “rubygems”
require “action_mailer”

ActionMailer::Base.delivery_method = :smtp

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

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


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

LoadModule ruby_module modules/

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?


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.