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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With