配置设备发送电子邮件
我编写了一个自定义邮件程序,每当用户收到通知时就会发送电子邮件。 由于某种原因,自定义邮件程序可以工作,但内置的设备邮件程序无法工作。 我无法发送确认电子邮件,
是我的配置中缺少某些内容吗?
-devise.rb:
config.mailer_sender = "[email protected]"
-setup_mail.rb:
require "development_mail_interceptor"
ActionMailer::Base.smtp_settings = {
:address => "smtp.gmail.com",
:port => 587,
:domain => "gmail.com",
:user_name => "usename",
:password => "pass",
:authentication => "plain",
:enable_starttls_auto => true
}
ActionMailer::Base.perform_deliveries = true
ActionMailer::Base.raise_delivery_errors = true
ActionMailer::Base.register_interceptor(DevelopmentMailInterceptor) if Rails.env.development?
I wrote a custom mailer that sends an email whenever a user receives a notification.
for some reason the custom mailer works but the built in devise mailer doesn't work.
I'm not able to send confirmation emails
is something missing in my configuration ?
-devise.rb:
config.mailer_sender = "[email protected]"
-setup_mail.rb:
require "development_mail_interceptor"
ActionMailer::Base.smtp_settings = {
:address => "smtp.gmail.com",
:port => 587,
:domain => "gmail.com",
:user_name => "usename",
:password => "pass",
:authentication => "plain",
:enable_starttls_auto => true
}
ActionMailer::Base.perform_deliveries = true
ActionMailer::Base.raise_delivery_errors = true
ActionMailer::Base.register_interceptor(DevelopmentMailInterceptor) if Rails.env.development?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我相信,调查
将为您解决问题:
你可以取消注释它!
I believe that looking into
will do the trick for you:
you can uncomment it!
我今天发现一个问题,花了 5 个小时来解决。
当确认令牌关系列为空时,设计的确认电子邮件无法工作。当列为空时,效果很好。
希望在遇到这个问题时对您有所帮助。〜
I catch an issue today and I spend 5 hours on it.
Devise 's confirmation email cannot work when the confirmation_token relational columns is blank. Well when the columns is null it works well.
hope help U when catching this issue alike.~