2014-02-09 19 views

回答

2

您可以通过开发和任何您配置了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 
    } 

http://guides.rubyonrails.org/action_mailer_basics.html

相关问题