2
我在我的电子邮件服务应用程序中使用了actionmailer,但我很困惑我们可以通过ruby-on-rails的开发模式发送电子邮件,或者我们只能通过生产模式发送电子邮件。我们可以通过Ruby on Rails的开发模式发送电子邮件吗?
我在我的电子邮件服务应用程序中使用了actionmailer,但我很困惑我们可以通过ruby-on-rails的开发模式发送电子邮件,或者我们只能通过生产模式发送电子邮件。我们可以通过Ruby on Rails的开发模式发送电子邮件吗?
您可以通过开发和任何您配置了SO LONG的环境发送电子邮件,因为您已经配置了环境配置。我倾向于在开发模式中使用简单的gmail。
的例示为如下,我想添加到我的config/environments/development.rb
:
config.action_mailer.default_url_options = {:host => 'localhost:8080'}
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
:address => "smtp.gmail.com",
:port => 587,
:domain => 'example.com',
:user_name => ENV['GMAIL_ADDRESS'],
:password => ENV['GMAIL_PASSWORD'],
:authentication => 'plain',
:enable_starttls_auto => true
}