我得到了一個軌道4應用程序與以下郵件配置:ArgumentError:發送郵件需要SMTP To地址。設置消息smtp_envelope_to,要,CC或BCC地址
config.action_mailer.delivery_method = :smtp
config.action_mailer.default_url_options = { host: 'myhost.com' }
config.action_mailer.perform_deliveries = true
config.action_mailer.smtp_settings = {
:enable_starttls_auto => true,
:address => 'smtp.myhost.com',
:port => 587,
:domain => 'myhost.com',
:authentication => :login,
:enable_starttls_auto => false,
:tls => false,
:openssl_verify_mode => 'none',
:ssl => false,
:user_name => "myusername",
:password => "mypassword"
}
每次我嘗試發送郵件帶有一個測試郵件設置:
class TestMailer < ActionMailer::Base
default :from => "[email protected]"
def welcome_email
mail(:to => "[email protected]", :subject => "Test mail", :body => "Test mail body")
end
end
TestMailer.welcome_email.deliver
我得到這個異常:
ArgumentError: An SMTP To address is required to send a message. Set the message smtp_envelope_to, to , cc, or bcc address.
難道我忘了什麼東西來設置? ,我無法找到「smtp_envelope_to」的配置選項
Thx我的失敗是一個smtp地址的重寫,它將它設置爲零Oo – bulleric