0
私は2つの方法でactionmailerを使用しました。 Gmailのsmtpを設定した最初のメール: -actionmailerのレールを使用すると実行が終了しました4
config.action_mailer.default_url_options = { :host => 'localhost:3000' }
config.action_mailer.delivery_method = :smtp
config.action_mailer.perform_deliveries = true
config.action_mailer.raise_delivery_errors = true
config.action_mailer.default :charset => "utf-8"
ActionMailer::Base.delivery_method = :smtp # be sure to choose SMTP delivery
ActionMailer::Base.smtp_settings = {
:address => "smtp.gmail.com",
:port => "587",
:domain => "gmail.com",
:user_name => "[email protected]",
:password => "some-password",
:authentication => "plain",
:enable_starttls_auto => true
}
これはとてもうまく動作します。メールが送られました。私は設定して自分のサーバーに自分のメールサーバーを使用することを決定したとき
問題がある: -
config.action_mailer.default_url_options = { :host => 'localhost:3000' }
config.action_mailer.delivery_method = :smtp
config.action_mailer.perform_deliveries = true
config.action_mailer.raise_delivery_errors = true
config.action_mailer.default :charset => "utf-8"
ActionMailer::Base.delivery_method = :smtp # be sure to choose SMTP delivery
ActionMailer::Base.smtp_settings = {
:address => "mail.xgram.xyz",
:port => "25",
:domain => "xgram.xyz",
:user_name => "[email protected]",
:password => "some-password",
:authentication => "plain",
:enable_starttls_auto => true
}
この構成では、私は、端末
ネット::です。OpenTimeout(このエラーを得ました実行は)期限切れ:
と、ブラウザでこのエラー
実行はまた
期限切れ私は任意の名前に変更したときに、エラーが
のgetaddrinfoとなりますので、サーバー名として
を知られていませんmail.xgram.xyz
は、有効である:名前またはサービス
誰でも助けてくれますか? ありがとうございます
オペレーティングシステム、ApacheのWebサーバー構成、またはレール構成に関連するシステム構成を意味しましたか? – omarzouk
OSに関連する設定。これを参照してください 'http://stackoverflow.com/a/26518579/2657566' –
私はこれはIPv6の問題ではないと思う。コメントの質問では、同僚はすでに私と一緒にうまく動作しているGmailの設定を使用していました。私の問題は、自分のSMTPを設定するときです。 – omarzouk