2

Hi I am trying to initialize the ActionMailer::Base:Class with some data:

ActionMailer::Base.add_delivery_method :ses, AWS::SES::Base,
  :access_key_id     => '0PxxxxxxxxxxxxS8Dyyy',
  :secret_access_key => 'aJxxxxxxxxxxxxx2Tpppa+ZQ6dddddddkN2'

But this throws an error:

`method_missing': undefined method `add_delivery_method' for ActionMailer::Base:Class (NoMethodError)

My Rails version - 3.2.13

What am I doing wrong?

serpent403
  • 803
  • 16
  • 32

1 Answers1

2

Most likely, what you are trying to do should be in an environment file, i.e. config/environments/production.rb. Do it like this:

  config.action_mailer.delivery_method = :smtp

  config.action_mailer.smtp_settings = {
    :address => "email-smtp.us-east-1.amazonaws.com",
    :user_name => "..." # Your SMTP user here.
    :password => "...", # Your SMTP password here.
    :authentication => :login,
    :enable_starttls_auto => true
  }

Did you take a look at this question: Using Amazon SES with Rails ActionMailer?

Community
  • 1
  • 1
Christoph Petschnig
  • 4,047
  • 1
  • 37
  • 46