title: Ruby on Rails: bad username / password? (535 Auth failed)
body: <p>I just finished my ruby foundations coursework at Bloc and I'm starting to bury my head into rails development. Things were going smooth until I hit this snag with devise and confirmation emails. I tried googling and looking around at some other questions but couldn't really find any that gave me anything that I could pull from and apply to my situation.</p>
  <p>I'm receiving the following error when signing up for an account.</p>
  <h1>Net::SMTPAuthenticationError in Devise::RegistrationsController#create</h1>
  <h2>535 Authentication failed: Bad username / password</h2>
  <hr />
  <p>Error extracted from source around line #976</p>
  <pre><code>def check_auth_response(res)
    unless res.success?
      raise SMTPAuthenticationError, res.message
    end
  end
  </code></pre>
  <hr />
  <p>From other posts I know you'll probably want to see that I have a config/initializers/setup_mail.rb file that looks like this:</p>
  <pre><code>if Rails.env.development?
    ActionMailer::Base.delivery_method = :smtp
    ActionMailer::Base.smtp_settings = {
      address:        'smtp.sendgrid.net',
      port:           '587',
      authentication: :plain,
      user_name:      ENV['SENDGRID_USERNAME'],
      password:       ENV['SENDGRID_PASSWORD'],
      domain:         'heroku.com',
      enable_starttls_auto: true
    }
  end
  </code></pre>
  <hr />
  <p>And here's an application.yml file EXAMPLE:</p>
  <pre><code>SENDGRID_PASSWORD: 
  SENDGRID_USERNAME:
  SECRET_KEY_BASE:
  </code></pre>
  <hr />
  <p>also I have the following in my config/environments/development.rb before anybody suggests it:</p>
  <pre><code>config.action_mailer.default_url_options = { host: 'localhost:3000'}
  config.action_mailer.delivery_method = :smtp
  config.action_mailer.perform_deliveries = true
  # Override Action Mailer's 'silent errors' in development
  config.action_mailer.raise_delivery_errors = true
  </code></pre>
  <hr />
  <p>If there's any other files that you'd like to see let me know and I'll add them to this post.</p>