Gmail を使って Net::SMTPAuthenticationError が出力される場合の解決法

たとえば、 Ruby でこんなコードを書いてメールを送信したいとする。 require 'mail' options = { address: 'smtp.gmail.com', port: 587, domain: 'gmail.com', user_name: USER_NAME, password: PASSWORD, authentication: 'plain', enable_starttls_auto: true } Mail.defaults do delivery_method :smtp, options end …