Forum: Ruby on Rails Unable Send Email through SMTP

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
174dad5d84e4dce9b21365418d5765ae?d=identicon&s=25 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: "smtp.gmail.com",
  port: 587,
  domain: "gmail.com",
  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
though
in the console it shows as below
Sent mail to emailid (30012.9ms)
Date: Thu, 23 Apr 2015 15:40:29 +0530
From: emailid@gmail.com
To: emails@gmail.com
Message-ID: <5538c5159d8dd_2646236a9652297a1@name-VirtualBox.mail>
Subject: SMT
Mime-Version: 1.0
Content-Type: text/html;
 charset=UTF-8
Content-Transfer-Encoding: 7bit

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





and Error outs as


*Net::OpenTimeout (execution expired):*
8a3f4f8e13e0660f1123a096ceae939c?d=identicon&s=25 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,
https://support.google.com/a/answer/176600?hl=en

Specifically you may need to be using, smtp-relay.gmail.com

HTH,
Paul
B51f0d8453e1edfe3839630ed7ffd16e?d=identicon&s=25 Cody Skidmore (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
apps"
in the account settings. If you're using the latter, you must use SSL.
I'm
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        =>
'smtp.gmail.com',
  :port           => '465',   :authentication => 'plain',   :user_name
 => 'exa...@example.com',   :password       => 'yourpassword',   :domain
      => 'yourd...@example.com',   :ssl            => true }
B51f0d8453e1edfe3839630ed7ffd16e?d=identicon&s=25 Cody Skidmore (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
port'}
  config.action_mailer.delivery_method = :smtp
  config.action_mailer.perform_deliveries = true
174dad5d84e4dce9b21365418d5765ae?d=identicon&s=25 Annapoorna R (Guest)
on 2015-04-27 06:49
(Received via mailing list)
Hello,

@paul , @cody

Thank you for the reply, I used ordinary gmail account, I did work
around
your solutions but no luck.. the error "*Net::OpenTimeout (execution
expired):*."  stopped appearing, but mails were not delivered.
57bad49cfb14591d5b8ae27cf84eab5b?d=identicon&s=25 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
so
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.