欢迎来到cool的博客
7

Music box

Click to Start

点击头像播放音乐
新博客链接

Rails — devise 发送修改密码邮件

修改服务器发件人的名称

config.mailer_sender property in config/devise/devise.rb allows you to specify that. If you don't have config/devise/devise.rb, run devise:install generator.

config/initializers/devise.rb

config.mailer_sender = '330469102@qq.com'   

配置服务器地址端口号

config/environment/development.rb

config.action_mailer.default_url_options = {:host => '119.254.103.134:3456'

配置smtp信息

config/environment.rb

ActionMailer::Base.delivery_method = :smtp
ActionMailer::Base.smtp_settings = { 
  :address => "smtp.163.com",
  :port => 25, 
  :domain => "duxiao.siwei.tech",
  :user_name => "330469102@qq.com",
  :password => "******"
}

设置mail信息在app/views/devise/mailer/reset_password_instructions.html.erb

返回列表