【问题标题】:Emails notifications are not sent from the God gem电子邮件通知不是从 God gem 发送的
【发布时间】:2011-06-30 10:00:22
【问题描述】:

我使用God gem 来监控我的delayed_job 进程,到目前为止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 = '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

有什么想法吗?

【问题讨论】:

    标签: ruby-on-rails ruby rubygems delayed-job god


    【解决方案1】:

    根据邮件列表中的this post

    1. gem install tlsmail
    2. 在邮件中添加Net::SMTP.enable_tls(OpenSSL::SSL::VERIFY_NONE) 上帝配置的一部分
    3. 使用:login 而不是true 作为server_auth 设置。

    【讨论】:

    • 感谢您的回复,我已按照建议完成并收到以下错误:Net::SMTP:Class 的未定义方法 `enable_tls' 这是我的上帝电子邮件配置:God::Contacts:: Email.defaults 做 |d| Net::SMTP.enable_tls(OpenSSL::SSL::VERIFY_NONE) d.from_email = 'system@example.com' d.from_name = '进程监控' 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_password = 'password' end
    • 我遇到了同样的问题,但在遵循这个答案后我收到:(信息:无法通过 smtp 向 my@email.com 发送电子邮件:到达文件末尾)这是一个改进但仍然没有为我完全解决这个问题......
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-07-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多