title: 535-5.7.8 Username and Password not accepted
body: <p>I have a contact form and after submitting I am getting a Net::SMTPAuthenticationError <code>535-5.7.8 Username and Password not accepted</code></p>
  
  <p>It's pointing to the create action in the contacts controller <code>ContactMailer.new_contact(@contact).deliver</code></p>
  
  <p>I have restarted the server. I tried <a href="https://accounts.google.com/DisplayUnlockCaptcha">https://accounts.google.com/DisplayUnlockCaptcha</a>.</p>
  
  <p>I am in development.</p>
  
  <p>Contacts controller:</p>
  
  <pre><code> def new
        @contact = Contact.new
      end
  
      def create
        @contact = Contact.new(params[:message])
        if @contact.valid?
          ContactMailer.new_contact(@contact).deliver
          flash[:notice] = "Message sent! Thank you for contacting us."
          redirect_to root_url
        else
          render :action =&gt; 'new'
        end
      end
    end
  </code></pre>
  
  <p>Development.rb:</p>
  
  <pre><code>  config.action_mailer.raise_delivery_errors = true
    config.action_mailer.perform_deliveries = true
    config.action_mailer.delivery_method = :smtp
    config.action_mailer.smtp_settings = {
      address:              'smtp.gmail.com',
      port:                 587,
      domain:               'gmail.com',
      user_name:            'username@gmail.com',
      password:             'password',
      authentication:       'plain',
      enable_starttls_auto: true  }
  
    config.action_mailer.default_url_options = { :host =&gt; "localhost:3000" }
  </code></pre>