user3677652
user3677652

Reputation: 93

rails application not sending email

Developerment.rb

myapp::Application.configure do
  config.cache_classes = false

  #config.whiny_nils = true

  config.consider_all_requests_local       = true
  config.action_view.debug_rjs             = true
  config.action_controller.perform_caching = false

  config.action_mailer.raise_delivery_errors = true
  config.action_mailer.perform_deliveries = true

  #config.action_mailer.delivery_method = :sendmail

  config.active_support.deprecation = :log

  config.action_dispatch.best_standards_support = :builtin

  # config.log_level = :error
end

#log ActiveRecord
ActiveRecord::Base.logger = Logger.new(STDOUT) if defined? Rails::Console

I am seeing the in the log file the message "Sent mail to [email protected]". I have played with this line

#config.action_mailer.delivery_method = :sendmail

by uncommenting this and gave all these options :smtp, :sendmail or :test, but none seems to work.

Upvotes: 0

Views: 61

Answers (1)

Mavis
Mavis

Reputation: 2580

if you are using SMTP to send e-mails, then make sure you include the server configuration in your config/environments/$RAILS_ENV.rb file. here is an example:

config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
  address:              'smtp.gmail.com',
  port:                 587,
  domain:               'example.com',
  user_name:            '<username>',
  password:             '<password>',
  authentication:       'plain',
  enable_starttls_auto: true  }

Upvotes: 1

Related Questions