title: Ruby Mail gem: Connection refused - connect(2) (Errno::ECONNREFUSED)
body: <p>I'm trying to just do a simple mail delivery with the Ruby <a href="https://github.com/mikel/mail" rel="nofollow">mail</a> gem:</p>
  
  <pre><code>require 'mail'
  Mail.deliver do
     from    'me@test.lindsaar.net'
     to      'varatis@gmail.com'
     subject 'Here is the image you wanted'
     body    File.read('body.txt')
  end
  </code></pre>
  
  <p>But I get this error:</p>
  
  <pre><code>Users/varatis/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/smtp.rb:546:in `initialize': Connection refused - connect(2) (Errno::ECONNREFUSED)
  from /Users/varatis/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/smtp.rb:546:in `open'
  from /Users/varatis/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/smtp.rb:546:in `tcp_socket'
  from /Users/varatis/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/smtp.rb:555:in `block in do_start'
  from /Users/varatis/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/timeout.rb:58:in `timeout'
  from /Users/varatis/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/timeout.rb:89:in `timeout'
  from /Users/varatis/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/smtp.rb:555:in `do_start'
  from /Users/varatis/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/smtp.rb:525:in `start'
  from /Users/varatis/.rvm/gems/ruby-1.9.2-p290/gems/mail-2.4.4/lib/mail/network/delivery_methods/smtp.rb:144:in `deliver!'
  from /Users/varatis/.rvm/gems/ruby-1.9.2-p290/gems/mail-2.4.4/lib/mail/message.rb:2034:in `do_delivery'
  from /Users/varatis/.rvm/gems/ruby-1.9.2-p290/gems/mail-2.4.4/lib/mail/message.rb:231:in `deliver'
  from /Users/varatis/.rvm/gems/ruby-1.9.2-p290/gems/mail-2.4.4/lib/mail/mail.rb:140:in `deliver'
  from mailer.rb:2:in `&lt;main&gt;'
  </code></pre>
  
  <p>How can I fix this? I'm assuming it's something having to do with the default port Mail works with.</p>