Net :: SMTPAuthenticationError(535 5.7.1身份验证失败)

时间:2019-06-11 09:08:23

标签: smtp ruby-on-rails-5 production-environment mailer

您好,社区我一直在生产环境中发送邮件。 我收到错误

  

Net :: SMTPAuthenticationError(535 5.7.1身份验证失败

我使用telnet检查了我的凭据,并成功进行了身份验证。但是使用Rails失败,我遇到了致命错误。

production.rb中,我使用base64编码填充了信息,但没有编码,但是在Rails中仍然失败。

请帮助我。我错过了什么?

我在 production.rb 中得到了这个

config.action_mailer.default_url_options = { :host => 'contact@jaykoneagency.com' }
  config.action_mailer.delivery_method = :smtp
  config.action_mailer.smtp_settings = {
      :address              => 'ns0.ovh.net',
      :port                 => 587,
      :domain               => 'ns0.ovh.net',
      :authentication       => 'login',
      :user_name            => 'my_user_name',
      :password             => 'my_user_password',
      :enable_starttls_auto => true,
  }
  config.action_mailer.perform_deliveries = true
  config.action_mailer.default :charset => "utf-8"
  config.action_mailer.default_options = {from: 'my_user_name'}

应该像我手动使用telnet一样发送邮件。

0 个答案:

没有答案
相关问题