[英]Action Mailer with Devise | Forgot my Password
我正在嘗試使“忘記密碼”選項起作用,但是我認為我在設置內容時迷失了它。
當我在Google上搜索時,我讀到Devise有它自己的Action Mailer,所以我不必為其生成控制器和模型。
所以我編輯了config / enviroments / production.rb
config.action_mailer.default_url_options = { :host => 'example.com' }
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
:address => "smtp.example.com",
:port => 25,
:user_name => 'test@example.com',
:password => '123456',
:authentication => 'plain',
:enable_starttls_auto => true
}
並在我的config / initializers / devise.rb中
config.mailer_sender = "test@example.com"
當然,這沒有用。
SocketError (getaddrinfo: Name or service not known):
我堅信自己搞砸了或者忘記了很多設置:)
有人可以指導我如何設置“忘記密碼”選項嗎?
這是因為smtp.example.com
無效,
Socket.getaddrinfo("smtp.example.com", "smtp")
#SocketError: getaddrinfo: Name or service not known
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.