Devise, no E-Mails

霸气de小男生 提交于 2020-01-05 04:32:28

问题


I installed devise.

I run rails server -e development and set this line in config/environments:

config.action_mailer.default_url_options = {:host => 'localhost:3000'}

Devises says:

 message with a confirmation link has been sent to your email address. Please open the      link to activate your account.

But I didn't receive any mail.

What do you think?


回答1:


Add these lines to your development.rb file

config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
  :address              => "smtp.gmail.com",
  :port                 => 587,
  :domain               => 'baci.lindsaar.net',
  :user_name            => '<username>',
  :password             => '<password>',
  :authentication       => 'plain',
  :enable_starttls_auto => true  }

More info about sending and setting up email here



来源:https://stackoverflow.com/questions/14942120/devise-no-e-mails

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!