title: ActionMailer will not send mail?
body: <p>I am trying to set up a simple contact_us page in my dev environment where a user can send an inquiry using a form I have created. I have ActiveMailer and the Contact model/controller/view all set up but it doesn't seem to be working correctly. Any ideas? My log appears to show mail being sent.</p>
  
  <p>ActionMailer</p>
  
  <pre><code>class ContactConfirmation &lt; ActionMailer::Base
    default from: "from@example.com"
  
    def receipt(contact)
      @contact = contact
  
      mail to: 'myname@example.com',
        subject: contact.subject
    end
  end
  </code></pre>
  
  <p>Receipt</p>
  
  <pre><code>&lt;%= @contact.first_name %&gt; &lt;%= @contact.last_name %&gt;
  
  Writes:
  
  &lt;%= @contact.description %&gt;
  </code></pre>
  
  <p>ContactsController</p>
  
  <pre><code>class ContactsController &lt; ApplicationController
  
    def new
      @contact = Contact.new
    end
  
    def create
      @contact = Contact.new(contact_params)
      if @contact.submit_contact_info
        redirect_to users_path, notice: 'Submission successful. Somebody will get back to you shortly.'
      else
        render :new
      end
    end
  
    protected
  
    def contact_params
      params.require(:contact).permit(:first_name, :last_name, :email, :subject, :description)
    end
  end
  </code></pre>
  
  <p>Contact Model</p>
  
  <pre><code>class Contact &lt; ActiveRecord::Base
    validates_presence_of :email
    validates :email, format: { with: /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\Z/i }
    validates_presence_of :subject
    validates_presence_of :description
    validates_presence_of :first_name
    validates_presence_of :last_name
  
    def submit_contact_info
      if save
        ContactConfirmation.receipt(self).deliver
        return true
      end
    end
  end
  </code></pre>
  
  <p>Contact Form rendered in the contacts/new.html.erb file</p>
  
  <pre><code>&lt;%= simple_form_for @contact do |f| %&gt;
    &lt;%= f.input :first_name %&gt;
    &lt;%= f.input :last_name %&gt;
    &lt;%= f.input :email %&gt;
    &lt;%= f.input :subject %&gt;
    &lt;%= f.input :description, as: :text %&gt;
    &lt;%= f.submit 'Submit Contact Form' %&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>In Initializers folder I have an smtp.rb file:</p>
  
  <pre><code>if Rails.env.development?
    ActionMailer::Base.delivery_method = :smtp
    ActionMailer::Base.smtp_settings = {
      address: "localhost",
      port: 1025
    }
  end
  </code></pre>
  
  <p>After changing my config now getting the following error on <code>ContactConfirmation.receipt(self).deliver</code>:</p>
  
  <p>Errno::ECONNREFUSED in ContactsController#create
  Connection refused - connect(2)</p>
  
  <pre><code>def submit_contact_info
      if save
        ContactConfirmation.receipt(self).deliver
        return true
      end
    end
  </code></pre>