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