/views/my_mailer/newcomment.rhtml

From: <%= @comment.name %>

Email: <%= @comment.email %>

Website: <%= @comment.website %>

<%= @comment.comment %>

<%= link_to "Moderate Comments", :controller=>"comments", :action=>"list" %> /model/my_mailer.rb class MyMailer < ActionMailer::Base def newcomment(comment, sent_at = Time.now) @headers["Organization"] = "Beilabs.com" @subject = 'MyMailer#confirm' @recipients = 'jonathan@beilabs.com' @from = 'server@beilabs.com' @sent_on = sent_at @headers = {} @body = {} @comment = comment end end /controller/comments_controller.rb def create @comment = Comment.new(params[:comment]) @comment.article_id=params[:id] if @comment.save MyMailer::deliver_newcomment(@comment) flash[:notice] = 'Comment was successfully created.' redirect_to :action => 'list' else render :action => 'new' end end