title: Send mail via rake task : Missing host to link to
body: <p>I know this has been seen many times, but I don't get what I do wrong. I'm trying to send mails via a rake task, and I got this error</p>
  
  <blockquote>
    <p>Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true</p>
  </blockquote>
  
  <p>in the <code>staging</code> environment (hosted on heroku). What's bothering me is that when I fire up a console, I can send mails without any troubles. In development, no troubles wether I'm seding the mail directly of via the rake task. </p>
  
  <p>You can see the environment files, the mailer class and the rake task in <a href="https://gist.github.com/3376803" rel="nofollow">this gist</a>. I really don't get what I'm doing wrong here.</p>
  
  <p>Thanks a lot for your time!</p>