title: How do I create a email confirmation?
body: <p>I'm trying to make a simple email notification when a user signs up. </p>
  
  <p>My user sign up works fine, and I followed the <a href="http://railscasts.com/episodes/61-sending-email" rel="nofollow">"Sending Email"</a> tutorial exactly but can't get it to work. What am I doing wrong?</p>
  
  <p>user_controller.rb</p>
  
  <pre><code>class Admin::UsersController &lt; InheritedResources::Base
    before_filter :admin_only
  
    actions :index, :show, :new, :edit, :create, :update, :destroy
    respond_to :html
  
  #  def new
  #    @user = User.new(:invitation_token =&gt; params[:invitation_token])
  #    @user.email = @user.invitation.recipient_email  
  #  end  
  
    def create
      @user = User.new(params[:user])
      UserMailer.deliver_registration_confirmation(@user) &lt; -- where I added the mailer
      @user.save(false)
      respond_to do |format|
        format.html{ redirect_to admin_users_path}
      end
  
    end
  
    private
  
    def collection
      paginate_options ||= {}
      paginate_options[:page] ||= (params[:page] || 1)
      paginate_options[:per_page] ||= (params[:per_page] || 20)
      @search = User.search(params[:search])
      @users ||= @search.all.paginate(paginate_options)
    end
  end
  </code></pre>
  
  <p>environments/production.rb</p>
  
  <pre><code># Settings specified here will take precedence over those in config/environment.rb
  config.action_mailer.default_url_options = { :host =&gt; 'alpine.totaline.com' }
  
  config.action_mailer.raise_delivery_errors = true
  
  # set delivery method to :smtp, :sendmail or :test
  config.action_mailer.delivery_method = :smtp
  
  # these options are only needed if you choose smtp delivery
  config.action_mailer.smtp_settings = {
    :address        =&gt; 'smtp.gmail.com',
    :port           =&gt; 25,
    :domain         =&gt; 'alpine.totaline.com',
    :authentication =&gt; :login,
    :user_name      =&gt; 'emailname@gmail.com',
    :password       =&gt; 'thepassword'
  }
  </code></pre>
  
  <p>models/user_mailer.rb</p>
  
  <pre><code>class UserMailer &lt; ActionMailer::Base
    def registration_confirmation(user)
      recipients  user.email
      from        "webmaster@alpinechallenge.com"
      subject     "Thank you for Registering"
      body        "You are now registered on the Alpine Challenge!"
    end  
  end
  </code></pre>