Ruby on rails Rails ar_mailer无法发送电子邮件

Ruby on rails Rails ar_mailer无法发送电子邮件,ruby-on-rails,plugins,smtp,ar-mailer,Ruby On Rails,Plugins,Smtp,Ar Mailer,我刚刚将一个应用程序切换为使用ar_mailer,当我运行ar_sendmail(长时间暂停后)时,出现以下错误: Unhandled exception 530 5.7.0 Must issue a STARTTLS command first. h7sm16260325nfh.4 我正在使用Gmail SMTP发送电子邮件,并且我没有更改刚刚安装的ActionMailer::Base.SMTP\u设置 版本: Rails:2.1,ar_mailer:1.3.1您使用的ar_mailer版本

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

Unhandled exception 530 5.7.0 Must issue a STARTTLS command first. h7sm16260325nfh.4
我正在使用Gmail SMTP发送电子邮件,并且我没有更改刚刚安装的ActionMailer::Base.SMTP\u设置

版本:


Rails:2.1,ar_mailer:1.3.1

您使用的ar_mailer版本是什么?1.3.1中修复了gmail特有的bug,如下所示:


在lib中做了一些挖掘,似乎如果您想使用TLS(就像使用Gmail一样),那么它会在ActionMailer::Base.smtp\u设置中添加一个新选项:TLS(默认值为false),您应该将其设置为true


安装说明中提到的关于TLS的唯一一件事是删除任何其他smtp_TLS文件,但我之前的那个文件不需要TLS选项即可工作。

也许您使用的是Ruby版本1.8.7

您以前不需要使用
smtp\u tls

您只需添加
enable\u starts\u auto
选项:

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