Mail not sending

I am having trouble with one of my notifications. For some reason it
doesn’t seem to even try and send. I have notifications in other
locations and they send just fine.

Here is the code that should call the notification:

  # We want to set the updated_at time if the post was saved
  # Updating the number of replies would be good too.
  Conversation.update(params[:conversation_id], { :updated_at =>, :replies => replies })
User.update(session[:user].id, { :num_posts =>
(session[:user].num_posts += 1) })

  conv_owner = Conversation.find(params[:conversation_id]).user_id
  owner_email = User.find(conv_owner).email


  if session[:conversation]
    redirect_to :controller => 'conversations', :action =>

‘show’, :id => session[:conversation]

Here is the Notification method:

def new_thread_post(to, conversation_id, sent_at =
@subject = “Someone has posted to your thread”
@body[‘conversation_url’] = “
@recipients = to
@from = ‘[email protected]
@sent_on = sent_at
@headers = {}

And the template:

There has been a reply to your thread at:

<%= @conversation_url %>

When I make a thread post the code inside the if is run but I don’t
see anything in the logs about the notification sending or failing.
There is no postfix activity in /var/log/messages though so it would
appear that it doesn’t run or dies before trying to send the email.

Any ideas?


Thanks, I’ll toy around with it when I get home from work. Hopefully
it is just a formatting issue. Mail sends fine when an account is
created and when a user requests their log-in info.

Is there a way to turn on more verbose logging, specifically for

On Mon, 2008-02-04 at 17:30 -0800, Glen wrote:, :replies => replies })
‘show’, :id => session[:conversation]

Any ideas?

are you configured to do e-mail in environment.rb ?

something like this?

Include your app’s configuration here:

ActionMailer::Base.smtp_settings = {
:address => “My_SMTP_SERVER”,
:port => 25,
:domain => “
#:user_name => “[email protected]”,
#:password => “mypass”,
#:authentication => :login

also, this doesn’t appear to be valid in your example…

@body[‘conversation_url’] ={conversation_id}