【问题标题】:ActionMailer Rails : Not able to send emailsActionMailer Rails:无法发送电子邮件
【发布时间】:2011-08-11 06:20:26
【问题描述】:

我的 environment/development.rb 中有以下代码

 config.action_mailer.raise_delivery_errors = true;
 config.action_mailer.delivery_method = :smtp;
 config.action_mailer.smtp_settings = {
   :address => "smtp.gmail.com",
   :port => 587,
   :user_name => "my_id@gmail.com",
   :password => "secret",
   :authentication => :plain,
   :enable_starttls_auto => true,
   :domain => "localhost",
 }

一封电子邮件正在通过从一个调用邮件程序模型生成 我的控制器。但是,我无法发送或接收任何 gmail 上的电子邮件。

我使用的是 ruby​​ 1.8.7,rails 2.3.5。 没有例外,只是没有交换电子邮件 在实际的邮件服务器之间。

对 mailer 很陌生,对于任何新手问题,我们深表歉意。

类似的查询: Actionmailer not working in rails 2.3

谢谢

【问题讨论】:

    标签: ruby-on-rails email actionmailer


    【解决方案1】:

    在您的代码上方,您需要将这些行强制用于身份验证:

    require 'tlsmail'
    Net::SMTP.enable_tls(OpenSSL::SSL::VERIFY_NONE)
    

    您还需要 tlsmail gem。

    如果不起作用,您可以尝试从设置中删除域密钥。

    【讨论】:

      【解决方案2】:
      猜你喜欢
      • 1970-01-01
      • 2014-12-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-10-06
      • 2023-04-10
      • 1970-01-01
      相关资源
      最近更新 更多