title: How to setup a mail interceptor in rails 3.0.3?
body: <p>I am using rails 3.0.3, ruby 1.9.2-p180, mail (2.2.13). I m trying to setup a mail interceptor but I am getting the following error</p>
  
  <pre><code> /home/abhimanyu/Aptana_Studio_3_Workspace/delivery_health_dashboard_03/config/initializers/mailer_config.rb:16:in `&lt;top (required)&gt;': uninitialized constant DevelopmentMailInterceptor (NameError)
  </code></pre>
  
  <p>How do i fix it?</p>
  
  <p>The code I am using is shown below:</p>
  
  <pre><code>config/initializer/mailer_config.rb
  
  ActionMailer::Base.default_charset = "utf-8"
  ActionMailer::Base.default_content_type = "text/html"
  ActionMailer::Base.raise_delivery_errors = true
  ActionMailer::Base.perform_deliveries = true
  ActionMailer::Base.delivery_method = :smtp
  ActionMailer::Base.smtp_settings = {
  :enable_starttls_auto =&gt; true,
  :address =&gt; "secure.emailsrvr.com",
  :port =&gt; '25',
  :domain =&gt; "domain",
  :user_name =&gt; "user_name",
  :password =&gt; "password",
  :authentication =&gt; :plain
  </code></pre>
  
  <p>}</p>
  
  <pre><code>ActionMailer::Base.register_interceptor(DevelopmentMailInterceptor) if  Rails.env.development?
  </code></pre>
  
  <p>lib/development_mail_interceptor.rb</p>
  
  <pre><code>class DevelopmentMailInterceptor
  
    def self.delivering_email(message)
      message.to = "email"
    end
  
  end
  </code></pre>
  
  <p>Thanks in advance.</p>