2013-02-18 104 views
1

我安裝了設計。設計,沒有電子郵件

我運行Rails服務器-e發展和配置/環境設置這一行:

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

圖謀說:

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

但我沒有收到任何郵件。

您認爲如何?

+1

你有沒有設置在'development.rb' SMTP配置? – 2013-02-18 17:51:29

+0

沒有如何做到這一點?我還有另外一行:config.mailer_sender =「[email protected]」devise.rb – ubuseral 2013-02-18 18:01:03

回答

3

這些行添加到您的development.rb文件

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 } 

更多信息有關發送和設置電子郵件here

+0

非常感謝。默認情況下是否可以設置登錄,而無需爲root用戶進行註冊? – ubuseral 2013-02-18 18:32:33

+1

你可以手動創建一個用戶u = User.create(:email =>「[email protected]」,:password =>「123456」,:password_confirmation =>「123456」)'然後'u.confirm!無需點擊鏈接即可完成註冊 – benchwarmer 2013-02-18 18:44:40