Rubyメールgemを使用して単純なメール配信を実行しようとしています。
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
しかし、私はこのエラーが発生します:
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 `<main>'
どうすればこれを修正できますか? メールが動作するデフォルトのポートに関係していると思います。