首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Rails Zoho Net::SMTPAuthenticationError: 530

Rails Zoho Net::SMTPAuthenticationError: 530
EN

Stack Overflow用户
提问于 2017-08-04 21:10:12
回答 2查看 456关注 0票数 0

我正在尝试配置Zoho邮件smtp,但我不知道我做错了什么。在开发模式下,一切正常,但在生产环境中,当我发送电子邮件时,会出现以下错误:

代码语言:javascript
复制
Net::SMTPAuthenticationError: 530 5.5.1 Authentication Required.

我的生产环境设置:

代码语言:javascript
复制
config.action_mailer.delivery_method = :smtp
config.action_mailer.default_url_options = { host: 'not-real.com' }

config.action_mailer.smtp_settings = {
  port: 465,
  ssl: true,
  tls: true,
  authentication: :login,
  address: 'smtp.zoho.eu',
  domain: 'not-real.com',
  enable_starttls_auto: true,
  password:  ENV['ZOHO_PASSWORD'],
  user_name: ENV['ZOHO_USER_NAME']
}

首先,我认为问题出在错误的密码或user_name,但事实并非如此。接下来,我在Zoho控制面板->域中检查了域,但一切正常。在Zoho SMTP服务器配置中写道:

代码语言:javascript
复制
 Outgoing Server Name: smtp.zoho.eu
 Port: 465
 Security Type: SSL 

 Require Authentication: Yes. 

但是你能告诉我这是什么意思吗?->需要身份验证:是的。

我应该更改Zoho设置中的某些内容吗?

EN

回答 2

Stack Overflow用户

发布于 2017-08-08 18:29:10

代码语言:javascript
复制
config.action_mailer.delivery_method = :smtp

config.action_mailer.default_url_options = { host: 'example.com' }

config.action_mailer.smtp_settings = {
    port: 587,
    ssl: true,
    tls: true,
    authentication: :login,
    address: 'smtp.zoho.com',
    domain: 'mail.zoho.com',
    enable_starttls_auto: true,
    password:  'password',
    user_name: 'username'
}

这对我很管用。您的设置可能没有问题,某些本地网络会阻止这些类型的数据包。

票数 0
EN

Stack Overflow用户

发布于 2018-06-16 11:36:35

在文件末尾的production.rb中添加:

代码语言:javascript
复制
ActionMailer::Base.smtp_settings = {  
  :address              => 'smtp.zoho.com',  
  :port                 => 587, # change to 465 if using ssl 
  :domain               => 'zoho.com', # if you have no domain  
  :user_name            => 'YourUsername@zoho.com',  
  :password             => 'YourPassword',  
  :authentication       => 'plain',  # change to ssl or tls as required
  :enable_starttls_auto => true,
  :openssl_verify_mode => 'none'
}

  • 将上述代码添加到您的setup_mail.rb文件中。
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/45507738

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档