Actionmailer not working when I change gmail password

对着背影说爱祢 提交于 2019-11-28 01:46:12

Create a file named as setup_mail.rb in config/initializers/ folder so that it looks like

config/initializers/setup_mail.rb

and put the below code in that file:-

ActionMailer::Base.smtp_settings = {
  :address => "smtp.gmail.com",
  :port  => 587,
  :domain  => 'www.yourdomain.com',
  :user_name => "myaddress@gmail.com",
  :password => "mypassword",
  :authentication => 'plain',
  :enable_starttls_auto => true
}

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