Report this

What is the reason for this report?

Rails droplet, rails 4, gmail not sending

Posted on May 22, 2015
PHB

By PHB

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.action_mailer.smtp_settings = { address: “smtp.gmail.com”, port: 587, domain: “gmail.com”, authentication: :login, enable_starttls_auto: true, user_name: Rails.application.secrets.email_provider_username, password: Rails.application.secrets.email_provider_password } config.action_mailer.default_url_options = { :host => “smtp.gmail.com” } config.action_mailer.delivery_method = :smtp config.action_mailer.perform_deliveries = true config.action_mailer.raise_delivery_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

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.