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)
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
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
}
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
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.
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