2011-11-25 15 views
1

Postmarkappの経験がありますか?Rails 2.3:PostmarkappのSMTP設定:接続が拒否されました - connect(2)

私はレール2アプリ(放射cms)を持っており、SMTP経由でメールを送信しようとしています。

これは私のSMTP設定がどのように見えるかです:

config.action_mailer.smtp_settings = { 
    :address  => "smtp.postmarkapp.com", 
    :port   => '25', 
    :authentication => :plain, 
    :user_name  => 'postmark-ap-key', 
    :password  => 'postmark-ap-key', 
    :domain => 'postmarkapp.com' 
} 

メーラークラスを:

class RegistrationMailer < ActionMailer::Base 

    def send_email(email, sent_at = Time.now) 
    subject "Some text here" 
    recipients "#{email}" 
    from '[email protected]' 
    sent_on sent_at 
    body :text => "Some text here" 
    end 

end 

、ここでは、私は(コントローラのアクションで)お届けメソッドを呼び出すコードです

mail = RegistrationMailer.create_send_email(params[:email]) 
RegistrationMailer.deliver(mail) 

私はdeliverメソッドを呼び出すたびに 'Connection refused-connect(2)'エラーが発生しました。誰でも私が間違っていることを助けることができますか?私はherokuとsmtpの他の設定(sendgrid用)と全く同じコードを使用しましたが、問題なく動作しました。

答えて

0

私は自分でPostmarkを使用していませんが、システムを介してメールを送信するのに役立つ宝石があるようです。おそらくAPIキーを送信する必要があるためです。

https://github.com/wildbit/postmark-rails

http://rubygems.org/gems/postmark-rails

実装のための関連質問:How can I customize Devise to send password reset emails using PostMark mailer

+0

そしておそらくポート25への接続を拒否されましたが、ポート25 –

+0

上のファイアウォールやISPのブロックによって引き起こさ全く無関係な問題であり、ありますこの理由から、PostMarkが提供するポート2525もあります。 – mahemoff