0
因此,我的项目之一有一个SMTP服务器已配置为使用没有任何形式的身份验证。这是我在config/environments/production.rb
上的SMTP设置。Rails ActionMailer发送电子邮件没有身份验证
config.action_mailer.asset_host = 'http://example.com'
config.action_mailer.default_url_options = { host: 'example.com' }
config.action_mailer.delivery_method = :smtp
config.action_mailer.raise_delivery_errors = true
config.action_mailer.smtp_settings = {
address: 'mail.example.com',
port: 587,
domain: 'info.example.com',
user_name: '[email protected]',
password: '',
openssl_verify_mode: 'none',
authentication: nil,
tls: false,
enable_starttls_auto: false
}
我虽然authentication
模式需要被设置为nil
,但是,当我试图发送电子邮件,它给了我这个错误。
2.0.0-p481 :001 > CustomerMailer.test.deliver
Net::SMTPAuthenticationError: 503 5.5.1 Error: authentication not enabled
任何解决方案,家伙?
它给我'引发ArgumentError:SMTP-AUTH请求但缺少秘密phrase'错误。 – 2014-09-29 06:53:27
好的。它现在有效。谢谢。 :) – 2014-10-01 12:17:15