Unable Send Email through SMTP

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: [email protected]
To: [email protected]
Message-ID: [email protected]
Subject: SMT
Mime-Version: 1.0
Content-Type: text/html;
charset=UTF-8
Content-Transfer-Encoding: 7bit

Hi This a mail regarding the cell rotation

and Error outs as

Net::OpenTimeout (execution expired):

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, smtp-relay.gmail.com

HTH,
Paul

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

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
=> ‘[email protected]’, :password => ‘yourpassword’, :domain
=> ‘[email protected]’, :ssl => true }

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

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.