Forum: Ruby on Rails Unable Send Email through SMTP

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Annapoorna R (Guest)
on 2015-04-23 12:37
(Received via mailing list)
Hello All,

i have  this configuration in development.rb

config.action_mailer.delivery_method = :smtp

  config.action_mailer.smtp_settings = {
  address: "",
  port: 587,
  domain: "",
  authentication: "plain",
  enable_starttls_auto: true,
  user_name: emailid,
  password: password,
  ssl: true
  config.action_mailer.perform_deliveries = true

Using Rails 4 and ruby 2 versions, emails are not getting delivered
in the console it shows as below
Sent mail to emailid (30012.9ms)
Date: Thu, 23 Apr 2015 15:40:29 +0530
Message-ID: <5538c5159d8dd_2646236a9652297a1@name-VirtualBox.mail>
Subject: SMT
Mime-Version: 1.0
Content-Type: text/html;
Content-Transfer-Encoding: 7bit

<h2>Hi This a mail regarding the cell rotation </h2>

and Error outs as

*Net::OpenTimeout (execution expired):*
Paul Makepeace (Guest)
on 2015-04-23 20:03
(Received via mailing list)
Whom are you sending email to? Because which service you connect to,
and how, affects how Gmail restricts the recipients.

Make sure you're lined up fully with,

Specifically you may need to be using,

27cdfa936be2bfd59742e780feecdb72?d=identicon&s=25 Cody S. (cody_skidmore)
on 2015-04-24 15:15
(Received via mailing list)
Are you using an ordinary gmail account or a domain account hosted on
Google Apps? For the former, you can turn on "Access for less secure
in the account settings. If you're using the latter, you must use SSL.
not sure your port is correct. The following is a working configuration
using a domain account hosted on Google Apps.

ActionMailer::Base.smtp_settings = {   :address        =>
  :port           => '465',   :authentication => 'plain',   :user_name
 => '',   :password       => 'yourpassword',   :domain
      => '',   :ssl            => true }
27cdfa936be2bfd59742e780feecdb72?d=identicon&s=25 Cody S. (cody_skidmore)
on 2015-04-24 15:20
(Received via mailing list)
Here's the Environment Devise configuration.

  # Devise configuration settings
  config.action_mailer.default_url_options = { :host => 'your host
  config.action_mailer.delivery_method = :smtp
  config.action_mailer.perform_deliveries = true
Annapoorna R (Guest)
on 2015-04-27 06:49
(Received via mailing list)

@paul , @cody

Thank you for the reply, I used ordinary gmail account, I did work
your solutions but no luck.. the error "*Net::OpenTimeout (execution
expired):*."  stopped appearing, but mails were not delivered.
Saravanan B (Guest)
on 2015-04-27 12:14
(Received via mailing list)
1.) Check whether the mail id your using has two step verifiication if
change it.
2.) Check whether port 587 has been added in the IPtables if not add it
using below command.
iptables -I INPUT -p tcp --dport 22 -j ACCEPT
This topic is locked and can not be replied to.