title: ruby-gmail: Uncaught exception: 534-5.7.14 <https://accounts.google.com/ContinueSignIn?sarp=1&scc=1&plt=AKgnsbtMk
body: <p>I can manually login my account, but when i use ruby-gmail, it will raise err</p>
  
  <p>this is my code</p>
  
  <pre><code>require 'gmail'
  
  gmail = Gmail.new("myname@gmail.com", "passwd")
  
  gmail.deliver do
    to "rorocodeath@gmail.com"
    subject "Having fun in Puerto Rico!"
    text_part do
      body "Text of plaintext message."
    end
    html_part do
      content_type 'text/html; charset=UTF-8'
      body "&lt;p&gt;Text of &lt;em&gt;html&lt;/em&gt; message.&lt;/p&gt;"
    end
    add_file __FILE__
  end
  </code></pre>
  
  <p>this is my full output</p>
  
  <pre><code>Uncaught exception: 534-5.7.14 &lt;https://accounts.google.com/ContinueSignIn?sarp=1&amp;scc=1&amp;plt=AKgnsbtMk
  
      /home/roroco/.rbenv/versions/2.1.5/lib/ruby/2.1.0/net/smtp.rb:969:in `check_auth_response'
      /home/roroco/.rbenv/versions/2.1.5/lib/ruby/2.1.0/net/smtp.rb:740:in `auth_plain'
      /home/roroco/.rbenv/versions/2.1.5/lib/ruby/2.1.0/net/smtp.rb:732:in `authenticate'
      /home/roroco/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/ruby-gmail-0.3.1/lib/smtp_tls.rb:57:in `do_tls_start'
      /home/roroco/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/ruby-gmail-0.3.1/lib/smtp_tls.rb:18:in `start'
      /home/roroco/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/mail-2.6.1/lib/mail/network/delivery_methods/smtp.rb:112:in `deliver!'
      /home/roroco/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/mail-2.6.1/lib/mail/message.rb:248:in `deliver!'
      /home/roroco/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/ruby-gmail-0.3.1/lib/gmail.rb:107:in `deliver'
      /home/roroco/Dropbox/rbs/ro_plans/ex/ex.rb:5:in `&lt;top (required)&gt;'
  </code></pre>
  
  <p><strong>update</strong></p>
  
  <p>solution: <a href="https://security.google.com/settings/u/1/security/apppasswords">https://security.google.com/settings/u/1/security/apppasswords</a> > generate new for mail > remember it > fill it in ruby-gmail passwd </p>