title: uninitialized constant mailer DEFAULT_FROM
body: <p>It seems that when I run my application in production mode I am getting the following inside my console: </p>
  
  <pre><code>    /home/Desktop/Portal/app/mailers/holiday_mailer.rb:2:in 
  `&lt;class:HolidayMailer&gt;': uninitialized constant HolidayMailer::DEFAULT_FROM (NameError)
  </code></pre>
  
  <p>I have looked at the following SO question <a href="https://stackoverflow.com/questions/9269306/rails-3-action-mailer-uninitialized-constant">Rails 3 Action Mailer uninitialized constant</a>. It appears that I have not made that mistake as my set up is as followed:</p>
  
  <p><strong>environment.rb</strong></p>
  
  <pre><code>require File.expand_path('../application', __FILE__)
  
  # Initialize the rails application
  Portal::Application.initialize!
  ActionMailer::Base.delivery_method = :smtp
  DEFAULT_FROM = "portal@gmail.com"
  </code></pre>
  
  <p><strong>holiday mailer</strong></p>
  
  <pre><code>class HolidayMailer &lt; ActionMailer::Base
    default :from =&gt; DEFAULT_FROM
  
    def holiday_confirmation(holiday)
      @holiday = holiday
      mail(:to =&gt; holiday.user.email, :subject =&gt; "Your Absence Request")
    end
  end
  </code></pre>
  
  <p><strong>Holiday Controller</strong></p>
  
  <pre><code> def update()
      admin = User.find(current_user.role? :administrator)
      holiday = Holiday.find(params[:id])
      user = User.find(id = holiday.user_id)
  
      if holiday.update_attributes(params[:holiday])
        if holiday.state == "approved"
          user.absentdays = user.absentdays - (holiday.days_used).to_i
          user.save
        end
        redirect_to absence_path, :notice =&gt; "request updated!"
        #email the user to tell them the state of their holiday
        HolidayMailer.holiday_confirmation(holiday).deliver
      else
        render 'edit'
      end
    end
  </code></pre>
  
  <p>It seems though this is wrong</p>