Question
Rails droplet, rails 4, gmail not sending
I have the following setup:
Ubuntu Ruby on Rails on 14.04 (Nginx + Unicorn) (London location)
I have manually upgraded it to Rails 4.
The application is running fine, but I cannot send e-mails.
I have followed the tutorials on adding the Gmail MX records, the domain is pointed to the droplet, so everything is fine.
The account to send from is on Gmail.
Rails settings are the following:
config.actionmailer.smtpsettings = {
address: “smtp.gmail.com”,
port: 587,
domain: “gmail.com”,
authentication: :login,
enablestarttlsauto: true,
username: Rails.application.secrets.emailproviderusername,
password: Rails.application.secrets.emailproviderpassword
}
config.actionmailer.defaulturloptions = { :host => “smtp.gmail.com” }
config.actionmailer.deliverymethod = :smtp
config.actionmailer.performdeliveries = true
config.actionmailer.raisedelivery_errors = false
By testing it on a local machine, the code itself can send e-mails using the same credentials both in development and in production mode, so not likely that it is the code.
I have also configured postfix on the server (although I am not sure if that was necessary), and could send a test e-mail from the command line.
Mails are still not working from Rails.
Any ideas where to look for the problem ???
Thanks
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×