[英]SMTP settings in rails 2.3.4
我已经从Rails 3.0移到了Rails 2.3.4,所以目前是该版本的新手。我想为我的Rails 2.3.4应用程序设置SMTP设置,但无法像Rails 3.0那样找到要创建或使用的文件。 Mailchimp已被用作第三方电子邮件提供商来发送批量消息。
为开发环境配置: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"
}
通常在Rails 2中,您将那些设置放在config / environments / *。rb中。 因为您的开发设置将与生产环境等不同。
所以像这样:
config.action_mailer.smtp_settings = {
:address => "localhost",
:port => 2525
}
在config / environments / development.rb中的configure块中
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.