title: Email notifications in Rails
body: <p>In my Rails 3.2 project, I have a form to create a new post in <code>new.html.erb</code> in <code>app/views/posts/</code></p>
  
  <pre><code>&lt;%= form_for(@post) do |post_form| %&gt;
    ...
    &lt;div class="field"&gt;
      &lt;%= post_form.label :email %&gt;&lt;br /&gt;
      &lt;%= post_form.text_field :email %&gt;
    &lt;/div&gt;
    &lt;div class="field"&gt;
      &lt;%= post_form.label :title %&gt;&lt;br /&gt;
      &lt;%= post_form.text_field :title %&gt;
    &lt;/div&gt;
    &lt;div class="field"&gt;
      &lt;%= post_form.label :content %&gt;&lt;br /&gt;
      &lt;%= post_form.text_field :content %&gt;
    &lt;/div&gt;
    &lt;div class="actions"&gt;
      &lt;%= post_form.submit %&gt;
    &lt;/div&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>Then the <code>create</code> function in <code>posts_controller.rb</code></p>
  
  <pre><code>def create
    @post = Post.new(params[:post])  
    if @post.save
      format.html { redirect_to @post }
    else
      format.html { render action: "new" }
    end
  end
  </code></pre>
  
  <p>When the user submits a post, I want to send an email notification to <code>email</code> that "You have submitted a post with title <code>title</code> and content <code>content</code>." How can I do that?</p>