title: How to implement a mailing system with Rails that sends emails in the background
body: <p>I want to implement a reliable mailing system with Ruby on Rails that sends emails in the background as sending email sometimes takes like 10 seconds or more so I don't want the user to wait. Some ideas I thought of:</p>
  
  <ol>
  <li><p>Write to a table in DB a have a
  background process that go over and
  send email (concern: potential many
  reads/writes to DB slows down my
  application)   </p></li>
  <li><p>Messaging Queue
  background process / Rake task
  (concern: if server crashes queued
  mails will be lost also might eat up
  a lot of memory if many emails)</p></li>
  </ol>
  
  <p>I was wondering if you a know of a good solution that provides a balance between reliability and performance. </p>