Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sending email ruby on rails dev environment smtp cpanel

I'm having trouble sending email using ruby on rails. When I'm using the gmail smtp, it's working fine but when I tried to use the email I created in cpanel, I can't seem to send any emails now. Does anyone know how to configure this? Thanks.

here's my mailer_setup.rb under initializers folder

ActionMailer::Base.delivery_method = :smtp # be sure to choose SMTP delivery
ActionMailer::Base.smtp_settings = {
  :address              => "mail.humouno.com",
  :port                 => 25,
  :domain               => "humouno.com",
  :user_name            => "[email protected]",
  :password             => "********",
  :authentication       => "login",
  :enable_starttls_auto => true
}

Here's the development.rb under environment.rb

Humouno::Application.configure do
  config.cache_classes = false
  config.eager_load = false

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

  config.action_mailer.raise_delivery_errors = false

  config.active_support.deprecation = :log

  config.active_record.migration_error = :page_load
  config.action_mailer.perform_deliveries = true

  config.assets.debug = true
end

I'm trying to send the email in my localhost.

like image 204
Finks Avatar asked Mar 01 '26 12:03

Finks


1 Answers

Thanks for the other answers but I found out that the smtp port should be 587 instead of 25, I find it weird since in the cpanel config, it says that the smtp port is at port 25.

like image 60
Finks Avatar answered Mar 03 '26 02:03

Finks