を達成するためにどのように私は正常にこのスクリプトを使ってポート彼らのポート25(非セキュア)を使用してリモートサーバーに電子メールを送信されました:私は今行う必要がある何ルビーメールは、SSLメール
require 'rubygems'
require 'mail'
options = { :address => "mail.domain.com",
:port => 25,
:domain => 'mail.domain.com',
:user_name => '[email protected]',
:password => 'topsecret',
:authentication => 'login',
:enable_starttls_auto => true }
Mail.defaults do
delivery_method :smtp, options
end
mail = Mail.new do
from '[email protected]'
to '[email protected]'
subject 'This is a test email'
body File.read('body.txt')
end
puts mail.to_s
mail.deliver!
が使用され、その
/usr/local/rvm/rubies/ruby-1.8.7-p249/lib/ruby/1.8/timeout.rb:60:in `rbuf_fill': execution expired (Timeout::Error)
from /usr/local/rvm/rubies/ruby-1.8.7-p249/lib/ruby/1.8/net/protocol.rb:134:in `rbuf_fill'
from /usr/local/rvm/rubies/ruby-1.8.7-p249/lib/ruby/1.8/net/protocol.rb:116:in `readuntil'
from /usr/local/rvm/rubies/ruby-1.8.7-p249/lib/ruby/1.8/net/protocol.rb:126:in `readline'
from /usr/local/rvm/rubies/ruby-1.8.7-p249/lib/ruby/1.8/net/smtp.rb:911:in `recv_response'
from /usr/local/rvm/rubies/ruby-1.8.7-p249/lib/ruby/1.8/net/smtp.rb:554:in `do_start'
from /usr/local/rvm/rubies/ruby-1.8.7-p249/lib/ruby/1.8/net/smtp.rb:921:in `critical'
from /usr/local/rvm/rubies/ruby-1.8.7-p249/lib/ruby/1.8/net/smtp.rb:554:in `do_start'
from /usr/local/rvm/rubies/ruby-1.8.7-p249/lib/ruby/1.8/net/smtp.rb:525:in `start'
from /usr/local/rvm/gems/ruby-1.8.7-p249/gems/mail-2.2.10/lib/mail/network/delivery_methods/smtp.rb:127:in `deliver!'
from /usr/local/rvm/gems/ruby-1.8.7-p249/gems/mail-2.2.10/lib/mail/message.rb:243:in `deliver!'
from testmail.rb:30
私はそれもSSL認証プロセスを開始することができないため、これがあると思う:私はそれをしようとするとSSLポート466は、私はそれは約2分間一時停止し、これまで咳、メッセージの詳細を通常の出力を得ます。どうすればいいのですか?
私たちは466のポート割り当てを制御しておらず、ポート587は利用できません。 –
Net :: SMTPは、メールが使用するボックスからすぐにSSLをサポートしているようです。ここを見てください。 http://stackoverflow.com/questions/708858/how-to-send-mail-with-ruby-over-smtp-with-ssl-not-with-rails-no-tls-for-gmailあなたは猿のように見えますパッチNet :: SMTPは動作します.. – Doon
私はそれを試みましたが、残念なことにまったく同じ結果を生成します。 –