【问题标题】:Rails ar_mailer fails to send emailsRails ar_mailer 无法发送电子邮件
【发布时间】:2023-04-10 16:19:01
【问题描述】:

我刚刚将一个应用程序切换为使用 ar_mailer,当我运行 ar_sendmail(长时间停顿后)时,我收到以下错误:

Unhandled exception 530 5.7.0 Must issue a STARTTLS command first. h7sm16260325nfh.4

我正在使用 Gmail SMTP 发送电子邮件,并且我没有更改任何刚刚安装的 ar_mailer 的 ActionMailer::Base.smtp_settings。

版本:

Rails:2.1,ar_mailer:1.3.1

【问题讨论】:

    标签: ruby-on-rails plugins smtp ar-mailer


    【解决方案1】:

    在库中进行了一些挖掘,似乎如果您想使用 TLS(就像使用 Gmail 一样),那么它会在 :tls 的 ActionMailer::Base.smtp_settings 中添加一个新选项(默认为 false)您应该将其设置为 true。

    安装说明中提到的关于 TLS 的唯一一件事是删除任何其他 smtp_tls 文件,但我不需要 tls 选项才能工作。

    【讨论】:

      【解决方案2】:

      也许你使用的是 Ruby 1.8.7 版

      您之前不需要smtp_tls

      您只需要添加enable_startls_auto 选项:

      ActionMailer::Base.smtp_settings = {
        :enable_starttls_auto => true,
        ...
        ...
      }
      

      【讨论】:

        【解决方案3】:

        您使用的是哪个版本的 ar_mailer? 1.3.1 中修复了 gmail 特定的错误,如下所示:

        http://rubyforge.org/forum/forum.php?forum_id=16364

        【讨论】:

          猜你喜欢
          • 2011-08-11
          • 1970-01-01
          • 2015-07-25
          • 1970-01-01
          • 2013-09-22
          • 2011-02-18
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多