如何配置宝石来发送电子邮件资源? [英] How to config devise gem to send email to the resource?

查看:174
本文介绍了如何配置宝石来发送电子邮件资源?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用devise宝石,而不是我配置发送电子邮件到注册用户?

I am using devise gem not what should i configure to send emails to the registered user ?

我看到一些链接,但不明白.please帮助我

i have saw some links but did not understand .please help me

推荐答案

# ActionMailer Config in development/production rb file
config.action_mailer.default_url_options = { :host => 'localhost:3000' }
config.action_mailer.delivery_method = :smtp
# change to true to allow email to be sent during development
config.action_mailer.perform_deliveries = true
config.action_mailer.raise_delivery_errors = true

config.action_mailer.smtp_settings = {
  address: "smtp.gmail.com",
  port: 587,
  domain: "mail.google.com",####important
  authentication: "plain",
  enable_starttls_auto: true,
  user_name: ENV["GMAIL_USERNAME"],
  password: ENV["GMAIL_PASSWORD"]
}

config/initializers/devise.rb

config.mailer_sender = 'email@example.com'

这篇关于如何配置宝石来发送电子邮件资源?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆