我正在尝试配置Zoho邮件smtp,但我不知道我做错了什么。在开发模式下,一切正常,但在生产环境中,当我发送电子邮件时,会出现以下错误:
Net::SMTPAuthenticationError: 530 5.5.1 Authentication Required.我的生产环境设置:
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服务器配置中写道:
Outgoing Server Name: smtp.zoho.eu
Port: 465
Security Type: SSL
Require Authentication: Yes. 但是你能告诉我这是什么意思吗?->需要身份验证:是的。
我应该更改Zoho设置中的某些内容吗?
发布于 2017-08-08 18:29:10
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'
}这对我很管用。您的设置可能没有问题,某些本地网络会阻止这些类型的数据包。
发布于 2018-06-16 11:36:35
在文件末尾的production.rb中添加:
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文件中。https://stackoverflow.com/questions/45507738
复制相似问题