0

Rails 3.0 から Rails 2.3.4 に移行しました。現在、このバージョンの初心者です。Rails 2.3.4 アプリケーションの SMTP 設定を設定したいのですが、Rails 3.0 のように作成または使用するファイルが見つかりません。 Mailchimp は、大量のメッセージを送信するためのサード パーティの電子メール プロバイダーとして使用されています。

4

2 に答える 2

3

開発環境の設定: config/environments/development.rb

これは、Google アカウント経由でメールを送信する典型的な構成です。

config.action_mailer.perform_deliveries = false # Set it to true to send the email in dev mode
config.action_mailer.raise_delivery_errors = true
config.action_mailer.delivery_method = :smtp
config.action_mailer.default_url_options = { :host => "localhost:3000" }


ActionMailer::Base.smtp_settings = {
                    :address        => "smtp.gmail.com",
                    :port           => 587,
                    :authentication => :plain,
                    :user_name      => "user@gmail.com",
                    :password       => "password"
}
于 2011-06-27T12:38:32.690 に答える
1

通常、Rails 2 では、これらの設定を config/environments/*.rb に置きます。開発設定は本番などとは異なるためです。

次のようなものです:

  config.action_mailer.smtp_settings = {
    :address => "localhost",
    :port => 2525
  }

config/environments/development.rb の構成ブロックで

于 2011-06-27T12:34:02.910 に答える