私は、次のメーラーの設定とレール4アプリケーションました:ArgumentError:メッセージを送信するには、SMTP Toアドレスが必要です。 ccで、に、メッセージsmtp_envelope_toを設定し、または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.
それは私が何かを設定するのを忘れていることは可能です:
私はこの例外が発生しましたか。? と私は
Thx私の失敗はsmtpアドレスのオーバーライドであり、これは0に設定されていますOo – bulleric