title: Running into SMTP error when trying to send email in RoR app
body: <p>I've been desperately trying to send an email using the Action Mailer class in RoR, and even though the terminal shows that a message is being sent, it keeps returning with this error:</p>
  
  <pre><code> et::SMTPAuthenticationError: 534-5.7.14 &lt;https://accounts.google.com/ContinueSignIn?sarp=1&amp;scc=1&amp;plt=AKgnsbtOS
  
  from /Users/abhasarya/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/net/smtp.rb:968:in `check_auth_response'
  from /Users/abhasarya/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/net/smtp.rb:739:in `auth_plain'
  from /Users/abhasarya/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/net/smtp.rb:731:in `authenticate'...
  </code></pre>
  
  <p>Here's what my mailer class looks like within app/mailers/my_mailer.rb:</p>
  
  <pre><code>class MyMailer &lt; ActionMailer::Base
    default from: "from@example.com"
  
    def welcome_email(user) 
      @user = user
  
          mail(to: user.email,
               from: 'example_email@gmail.com',
               subject: 'Welcome!')
    end
  end
  </code></pre>
  
  <p>And here's what my config/application.rb file looks like:</p>
  
  <pre><code>config.action_mailer.delivery_method = :smtp
      config.action_mailer.smtp_settings = {
  
          address:              'smtp.gmail.com',
          port:                 587,
          #domain:               'gmail.com',
          user_name:            'example_email@gmail.com',
          password:             'my_password',
          authentication:       'plain',
          enable_starttls_auto: true  
  
          }
  
          config.action_mailer.default_url_options = {
              :host =&gt; "localhost",
              :port =&gt; 3000
          }
  </code></pre>
  
  <p>in my config/environments/development.rb file I also have these two lines:</p>
  
  <pre><code>  config.action_mailer.raise_delivery_errors = true
    config.action_mailer.perform_deliveries = true
  </code></pre>
  
  <p>My problem is that whenever I start the rails console (working in development, have no idea how to run in production), assign a user's email to the user variable then enter the command: <code>MyMailer.welcome_email(user).deliver</code></p>
  
  <p>the terminal says: </p>
  
  <pre><code>Rendered my_mailer/welcome_email.html.erb (11.7ms)
    Rendered my_mailer/welcome_email.text.erb (0.5ms)
  
  Sent mail to abhas.arya@yahoo.com (923.1ms)
  Date: Fri, 08 Aug 2014 13:54:38 -0400
  From: abhas.aryaa@gmail.com
  To: abhas.arya@yahoo.com
  Message-ID: &lt;53e50ededebb2_2b0b8082dbf8507c5@Abhass-MacBook-Pro.local.mail&gt;
  Subject: Welcome!
  Mime-Version: 1.0
  Content-Type: multipart/alternative;
   boundary="--==_mimepart_53e50eded7355_2b0b8082dbf85068f";
   charset=UTF-8
  Content-Transfer-Encoding: 7bit
  </code></pre>
  
  <p>but then renders the error. My views are simple enough that I didn't think I needed to include them here. I've desperately tried everything, including unlocking google captcha but still nothing works. I'd appreciate any help, all I want is for an email to get sent to the proper inbox. I'd love you forever if you can solve this issue!!!</p>