Rails 4, how to correctly configure smtp settings (gmail)

You have to set the domain correctly. Currently in the code posted its “mydomain.net”. Change it to gmail.com if you want to sent it via gmail.

config.action_mailer.smtp_settings = {
  address:              'smtp.gmail.com',
  port:                 587,
  domain:               'gmail.com',
  user_name:            '[email protected]',
  password:             'yourpassword',
  authentication:       :plain,
  enable_starttls_auto: true
}

Leave a Comment