Emails Not Sending

Hello Guys,

i have cloned this app
https://github.com/RailsApps/rails-devise-roles/

everything is fine but when i hit sign_up and fill out the form then it
should be sending an email but somehow it is not doing what it's
supposed to do.
my development.rb after replacing existing settings for email

config.action_mailer.smtp_settings = {
  address: 'smtp.gmail.com',
  port: 587,
  domain: 'gmail.com',
  user_name: 'my_email',
  password: 'my_password',
  authentication: 'plain',
  enable_starttls_auto: true }

Hello Guys,

i have cloned this app
https://github.com/RailsApps/rails-devise-roles/

everything is fine but when i hit sign_up and fill out the form then it
should be sending an email but somehow it is not doing what it's
supposed to do.
my development.rb after replacing existing settings for email

config.action_mailer.smtp_settings = {
  address: 'smtp.gmail.com',
  port: 587,
  domain: 'gmail.com',
  user_name: 'my_email',
  password: 'my_password',
  authentication: 'plain',
  enable_starttls_auto: true }

What is in development.log when you try to do it?

I have not done gmail from rails, presumably you googled to find the
appropriate configuration.

Colin

Colin

Colin Law wrote in post #1172030:

What is in development.log when you try to do it?

I have not done gmail from rails, presumably you googled to find the
appropriate configuration.

Colin

Colin

Oh My Dear Lord Please Forgive Me _/\_ Any One OutThere Please Help Me.

Ask for help -- ignore and disparage help given.

Not sure that's a winning strategy, but good luck with it.

Hassan Schroeder wrote in post #1172042:

Ask for help -- ignore and disparage help given.

Not sure that's a winning strategy, but good luck with it.

--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
http://about.me/hassanschroeder
twitter: @hassan
Consulting Availability : Silicon Valley or remote

I Have ask many questions here and he always confuses me a lot with
asking stuff no one ask for anywhere and eventually i left with 2 step
backwards from when i ask.

What Colin asks for is reasonable and predictable. He wants to see what the exact error messages are and he wants to see the code that generated the message. As well he wants to verify that you have at least completed a tutorial so you know what you are doing.

I agree with him.

Norm

If you truly believe that the question

   "What is in development.log when you try to do it?"

is taking you "2 step backwards", or is not a question that *any*
experienced developer would ask -- mm,kay.

So walk me through your mental process. Other than looking at the
log files, how would you reason about the failure of your program?
Where would you look for clues?

Asking for help on irc, stackoverflow, or anywhere is NOT a replacement for basic research on your own. Asking that you have basic competence…so yeh. This is a major pet peeve of mine.

–Rob

****NO ONE**** is going to help you if you don't look in your damned development log and tell us what is logged by your attempt to send email. Without that, all we can do is make wild guesses, whereas with that there's a decent chance someone will be able to tell you exactly what the problem is.

In addition the “woe is me” shit is not flattering.

–Rob

wooh Calm down guys there's no need to bite a chunk out of my ass,
that's totally my choice whom to no or yes. any problem leave the thread
~(-_-)~ as there are plenty of rails forum out there where seriously
wants to help if someone facing any problem other then flamming and
lecturing the shit out of him with dialogues #Peace/.Out

With the amount of time you've spent whining and arguing and acting like you're a victim...why not just share what's in your development.log file...as you were asked really early in this thread. You are not entitled to help, in fact we can just say f off, some might...I won't...so just do what we asked...because quite frankly -- all i've heard is you whine which is why I'm pissed at you personally.

Robby O'Connor wrote in post #1172062:

With the amount of time you've spent whining and arguing and acting like
you're a victim...why not just share what's in your development.log
file...as you were asked really early in this thread. You are not
entitled to help, in fact we can just say f off, some might...I
won't...so just do what we asked...because quite frankly -- all i've
heard is you whine which is why I'm pissed at you personally.

Started GET "/" for 127.0.0.1 at 2015-04-15 12:14:01 +0530
  [1m[36mActiveRecord::SchemaMigration Load (0.7ms)[0m [1mSELECT
"schema_migrations".* FROM "schema_migrations"[0m
Processing by VisitorsController#index as HTML
  [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "users"
  Rendered visitors/index.html.erb within layouts/application (36.5ms)
  Rendered layouts/_navigation_links.html.erb (51.2ms)
  Rendered layouts/_navigation.html.erb (65.1ms)
  Rendered layouts/_messages.html.erb (1.6ms)
Completed 200 OK in 3781ms (Views: 3640.1ms | ActiveRecord: 7.2ms)

Started GET "/users/sign_up" for 127.0.0.1 at 2015-04-15 12:14:08 +0530
Processing by Devise::RegistrationsController#new as HTML
  Rendered devise/registrations/new.html.erb within layouts/application
(287.0ms)
  Rendered layouts/_navigation_links.html.erb (1.6ms)
  Rendered layouts/_navigation.html.erb (4.6ms)
  Rendered layouts/_messages.html.erb (0.6ms)
Completed 200 OK in 1272ms (Views: 1016.6ms | ActiveRecord: 1.4ms)

Started POST "/users" for 127.0.0.1 at 2015-04-15 12:14:21 +0530
Processing by Devise::RegistrationsController#create as HTML
  Parameters: {"utf8"=>"✓",
"authenticity_token"=>"/hlfWSuave2dv+n5BSXb/iXSAAfyG7swubt34y0ctADi3sFWXMmt8IwpZoYYn/i+vRpvXnEcFyJmdpCoacXWww==",
"user"=>{"name"=>"Chirag Arya", "email"=>"edwardmaya008@gmail.com",
"password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]"},
"commit"=>"Sign up"}
  [1m[36m (0.4ms)[0m [1mbegin transaction[0m
  [1m[35mUser Exists (0.6ms)[0m SELECT 1 AS one FROM "users" WHERE
"users"."email" = 'edwardmaya008@gmail.com' LIMIT 1
  [1m[36mUser Load (1.2ms)[0m [1mSELECT "users".* FROM "users" WHERE
"users"."confirmation_token" = ? ORDER BY "users"."id" ASC LIMIT 1[0m
[["confirmation_token",
"f41567c6ddb783f39206ae49bef6415315fdbdda0bc7ecc3b6cdbd8cebe82bc7"]]
  [1m[35mSQL (2.2ms)[0m INSERT INTO "users" ("email",
"encrypted_password", "name", "role", "created_at", "updated_at",
"confirmation_token", "confirmation_sent_at") VALUES (?, ?, ?, ?, ?, ?,
?, ?) [["email", "edwardmaya008@gmail.com"], ["encrypted_password",
"$2a$10$R.hBU1Eo4koKO6i.HzVdPuxOzYcDGwo0iVZq2UNbs.bsqGLergAem"],
["name", "Chirag Arya"], ["role", 0], ["created_at", "2015-04-15
06:44:23.074144"], ["updated_at", "2015-04-15 06:44:23.074144"],
["confirmation_token",
"f41567c6ddb783f39206ae49bef6415315fdbdda0bc7ecc3b6cdbd8cebe82bc7"],
["confirmation_sent_at", "2015-04-15 06:44:25.369904"]]
  Rendered
/home/malware/.rvm/gems/ruby-2.2.0@finalproject/gems/devise-3.4.1/app/views/devise/mailer/confirmation_instructions.html.erb
(3.2ms)

Devise::Mailer#confirmation_instructions: processed outbound mail in
1233.2ms

Sent mail to edwardmaya008@gmail.com (5526.5ms)

The answer to what happened is right there in your logs, read it.

Robby O'Connor wrote in post #1172062:

With the amount of time you've spent whining and arguing and acting like
you're a victim...why not just share what's in your development.log
file...as you were asked really early in this thread. You are not
entitled to help, in fact we can just say f off, some might...I
won't...so just do what we asked...because quite frankly -- all i've
heard is you whine which is why I'm pissed at you personally.

Started GET "/" for 127.0.0.1 at 2015-04-15 12:14:01 +0530
   [1m[36mActiveRecord::SchemaMigration Load (0.7ms)[0m [1mSELECT
"schema_migrations".* FROM "schema_migrations"[0m
Processing by VisitorsController#index as HTML
   [1m[35m (0.5ms)[0m SELECT COUNT(*) FROM "users"
   Rendered visitors/index.html.erb within layouts/application (36.5ms)
   Rendered layouts/_navigation_links.html.erb (51.2ms)
   Rendered layouts/_navigation.html.erb (65.1ms)
   Rendered layouts/_messages.html.erb (1.6ms)
Completed 200 OK in 3781ms (Views: 3640.1ms | ActiveRecord: 7.2ms)

Started GET "/users/sign_up" for 127.0.0.1 at 2015-04-15 12:14:08 +0530
Processing by Devise::RegistrationsController#new as HTML
   Rendered devise/registrations/new.html.erb within layouts/application
(287.0ms)
   Rendered layouts/_navigation_links.html.erb (1.6ms)
   Rendered layouts/_navigation.html.erb (4.6ms)
   Rendered layouts/_messages.html.erb (0.6ms)
Completed 200 OK in 1272ms (Views: 1016.6ms | ActiveRecord: 1.4ms)

Started POST "/users" for 127.0.0.1 at 2015-04-15 12:14:21 +0530
Processing by Devise::RegistrationsController#create as HTML
   Parameters: {"utf8"=>"✓",
"authenticity_token"=>"/hlfWSuave2dv+n5BSXb/iXSAAfyG7swubt34y0ctADi3sFWXMmt8IwpZoYYn/i+vRpvXnEcFyJmdpCoacXWww==",
"user"=>{"name"=>"Chirag Arya", "email"=>"edwardmaya008@gmail.com",
"password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]"},
"commit"=>"Sign up"}
   [1m[36m (0.4ms)[0m [1mbegin transaction[0m
   [1m[35mUser Exists (0.6ms)[0m SELECT 1 AS one FROM "users" WHERE
"users"."email" = 'edwardmaya008@gmail.com' LIMIT 1
   [1m[36mUser Load (1.2ms)[0m [1mSELECT "users".* FROM "users" WHERE
"users"."confirmation_token" = ? ORDER BY "users"."id" ASC LIMIT 1[0m
[["confirmation_token",
"f41567c6ddb783f39206ae49bef6415315fdbdda0bc7ecc3b6cdbd8cebe82bc7"]]
   [1m[35mSQL (2.2ms)[0m INSERT INTO "users" ("email",
"encrypted_password", "name", "role", "created_at", "updated_at",
"confirmation_token", "confirmation_sent_at") VALUES (?, ?, ?, ?, ?, ?,
?, ?) [["email", "edwardmaya008@gmail.com"], ["encrypted_password",
"$2a$10$R.hBU1Eo4koKO6i.HzVdPuxOzYcDGwo0iVZq2UNbs.bsqGLergAem"],
["name", "Chirag Arya"], ["role", 0], ["created_at", "2015-04-15
06:44:23.074144"], ["updated_at", "2015-04-15 06:44:23.074144"],
["confirmation_token",
"f41567c6ddb783f39206ae49bef6415315fdbdda0bc7ecc3b6cdbd8cebe82bc7"],
["confirmation_sent_at", "2015-04-15 06:44:25.369904"]]
   Rendered
/home/malware/.rvm/gems/ruby-2.2.0@finalproject/gems/devise-3.4.1/app/views/devise/mailer/confirmation_instructions.html.erb
(3.2ms)

Devise::Mailer#confirmation_instructions: processed outbound mail in
1233.2ms

Sent mail to edwardmaya008@gmail.com (5526.5ms)
Date: Wed, 15 Apr 2015 12:14:26 +0530
From: no-reply@gmail.com
Reply-To: no-reply@gmail.com
To: edwardmaya008@gmail.com
Message-ID: <552e08cab9fc7_715f61f23c6852d3@Unbeatable-Lord.mail>
Subject: Confirmation instructions
Mime-Version: 1.0
Content-Type: text/html;
  charset=UTF-8
Content-Transfer-Encoding: 7bit

<p>Welcome edwardmaya008@gmail.com!</p>

<p>You can confirm your account email through the link below:</p>

<p><a
href="http://localhost:3000/users/confirmation?confirmation_token=mHp8SdA1M21y8qSgFiBM">Confirm
my account</a></p>

   [1m[36m (0.7ms)[0m [1mrollback transaction[0m
Completed 500 Internal Server Error in 10379ms (ActiveRecord: 5.0ms)

*Net::SMTPAuthenticationError - 530-5.5.1 Authentication Required. Learn
more at*
:

This is your problem.

Also to add: if you encounter issues like this ALWAYS ALWAYS ALWAYS check logs whether it be testing, production or development...it will tell you what's wrong.

Robby O'Connor wrote in post #1172066:

Also to add: if you encounter issues like this ALWAYS ALWAYS ALWAYS
check logs whether it be testing, production or development...it will
tell you what's wrong.

I still don't get you. where m i wrong ?
if you could answer me keeping in mind as i'm a novice user :confused:

There was an authentication error against the google servers. That’s it.

Norbert Melzer wrote in post #1172069:

There was an authentication error against the google servers. That's it.

And how m i supposed to resolve this ? any further guidence

Proofread username and password, double check server settings, google a tutorial about how to use activemailer with gmail.

Norbert Melzer wrote in post #1172071:

Proofread username and password, double check server settings, google a
tutorial about how to use activemailer with gmail.

i am doing google searching from yesterday and then i asked here :v

i have cloned this app
https://github.com/RailsApps/rails-devise-roles/

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