Ruby on rails 电子邮件通知不是从上帝宝石发送的
我使用God gem来监控我延迟的工作流程,到目前为止,gem正在做它应该做的工作,但由于某种原因,我无法让他发送电子邮件通知(我使用谷歌应用程序)。 以下是我的god文件配置:Ruby on rails 电子邮件通知不是从上帝宝石发送的,ruby-on-rails,ruby,rubygems,delayed-job,god,Ruby On Rails,Ruby,Rubygems,Delayed Job,God,我使用God gem来监控我延迟的工作流程,到目前为止,gem正在做它应该做的工作,但由于某种原因,我无法让他发送电子邮件通知(我使用谷歌应用程序)。 以下是我的god文件配置: God::Contacts::Email.defaults do |d| d.from_email = 'system@example.com' d.from_name = 'Process monitoring' d.delivery_method = :smtp d.server_host = 's
God::Contacts::Email.defaults do |d|
d.from_email = 'system@example.com'
d.from_name = 'Process monitoring'
d.delivery_method = :smtp
d.server_host = 'smtp.gmail.com'
d.server_port = 587
d.server_auth = true
d.server_domain = 'example.com'
d.server_user = 'system@example.com'
d.server_password = 'myPassword'
end
God.contact(:email) do |c|
c.name = 'me'
c.group = 'developers'
c.to_email = 'me@example.com'
end
w.start_if do |start|
start.condition(:process_running) do |c|
c.interval = 20.seconds
c.running = false
c.notify = {:contacts => ['me'], :priority => 1, :category => 'staging'}
end
有什么想法吗?根据邮件列表:
gem安装tlsmail
Net::SMTP.enable_tls(OpenSSL::SSL::VERIFY_NONE)
上帝的一部分:登录intead oftrue
进行server\u auth
设置李>
感谢您的回复,我按照建议完成了操作,并收到以下错误:未定义的方法'enable_tls'for Net::SMTP:Class这是我的god电子邮件配置:god::Contacts::email.defaults do | d | Net::SMTP.enable_tls(OpenSSL::SSL::VERIFY_NONE)d.从你的电子邮件地址system@example.com'd.from_name='Process monitoring'd.delivery_method=:smtp d.server_host='smtp.gmail.com'd.server_port=587 d.server_auth=:login d.server_domain='example.com'd.server_user='system@example.com“d.server\u password=”password“endI遇到了同样的问题,但在遵循这个答案后,我收到:(信息:无法向发送电子邮件)my@email.com通过smtp:到达文件结尾)这是一个改进,但仍然没有完全解决这对我来说。。。