1

Rubyコードからのメールは問題なく送信されています。しかし、Railsコンソールから送信しようとすると、電子メール(Notifier)で指定されていMissing required header 'From'てもエラーが発生Fromします。以下を参照してください。

def send_email(user)
    recipients "#{user.email}"
    from       %("Name" "<name@domain.com>")
    subject   "Subject Line"
    content_type "text/html"
end

Railsコンソールからのメール送信コードは次のとおりです。

ActionMailer::Base.delivery_method = :amazon_ses
ActionMailer::Base.custom_amazon_ses_mailer = AWS::SES::Base.new(:secret_access_key => 'abc', :access_key_id => '123')
Notifier.deliver_send_email

私は何かが足りないのですか?

使用したGEMS:rails(2.3.5)、aws-ses(0.4.4)、mail(2.3.0)

4

1 に答える 1

2

修正方法は次のとおりです。

def send_email(user)
    recipients "#{user.email}"
    from       "'First Last' <name@domain.com>"   # changing the FROM format fixed it.
    subject   "Subject Line"
    content_type "text/html"
end
于 2011-12-29T11:28:00.427 に答える