Emails Not Sending

On 15 April 2015 at 10:15, Edward M. [email protected] wrote:

have a look at it
yesterday when it was working, when i sign up a new user and try to
access users after sign up then it gives error :access denied, so any
way to make a user admin ?

another one is today when i hit signup it is giving me error i described
before and the normal gmail smtp settings aren’t working as you can see
in the development.rb and production.rb and in secrets.yml file

Some advice, concentrate on one problem at a time when asking for
help. By asking another two questions in the same thread you have
just complicated the situation and no-one will know which problem to
respond to. So here concentrate on sorting your google authentication
problem. To ask the other questions start new threads with
appropriate subject lines. Also it is no good asking people to go
and look at an app you have cloned, no-one has the time for that. You
must ask targeted questions about specific issues you are having and
show us the specific bit of code that you are having trouble with.


As a RoR novice myself, I can tell you that you are NOT doing your home
work before asking questions … you are NOT putting in the necessary
time, patience and resolve required to find a solution for YOURSELF …

However, in about 15 secs I found on the internet a possible hint to
what your problem is


I use devise with Google apps hosted email which requires ssl. I’ll post
the configuration tomorrow.

put this code in


config.action_mailer.raise_delivery_errors = true
config.action_mailer.default_url_options = { :host => ‘localhost:3000’
config.action_mailer.delivery_method = :smtp

ActionMailer::Base.smtp_settings = {
:address => “”,
:port => 587,
:domain => “”,
:user_name => “[email protected]",
:password => “gmail-password",
:authentication => “plain”,
:enable_starttls_auto => true

The following snippets are a working example of setting up
ActionMailer/Devise using a domain email account hosted on Google Apps
Rails 4.2/Ruby 2.2.1. This is different than using regular Gmail account
which only requires you to go into the account settings and turn on
for less secure apps”. This setting isn’t available for the former. You
must use SSL instead.

From development.rb:

Devise configuration settings

config.action_mailer.default_url_options = { :host =>
config.action_mailer.delivery_method = :smtp
config.action_mailer.perform_deliveries = true

From setup_mail.rb:
ActionMailer::Base.smtp_settings = { :address =>’,
:port => ‘465’, :authentication => ‘plain’, :user_name
=> ‘[email protected]’, :password => ‘yourpassword’,
=> ‘[email protected]’, :ssl => true }

This is a great video tutorial on setting up devise:


Cody S.

I would also advise using mailcatcher in development…you don’t need
gmail in development – only maybe when you deploy to test production

Nice tip. Thanks.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs