def send_smtp(mail)
      smtp = Net::SMTP.new(SMTP_SERVER, SMTP_PORT)
      smtp.enable_starttls_auto
      secret = {
        :consumer_key => SMTP_CONSUMER_KEY, 
        :consumer_secret => SMTP_CONSUMER_SECRET,
        :token => @email_credentials[:smtp_oauth_token],
        :token_secret => @email_credentials[:smtp_oauth_token_secret]
      }
      smtp.start(SMTP_HOST, @email_credentials[:email], secret, :xoauth) do |session|
        print "Sending message..."
        session.send_message(mail.encoded, mail.from_addrs.first, mail.destinations)
        puts ".sent!"
      end
    end
def send_smtp(mail)
      smtp = Net::SMTP.new(SMTP_SERVER, SMTP_PORT)
      smtp.enable_starttls_auto
      secret = {
        :consumer_key => SMTP_CONSUMER_KEY, 
        :consumer_secret => SMTP_CONSUMER_SECRET,
        :token => @email_credentials[:smtp_oauth_token],
        :token_secret => @email_credentials[:smtp_oauth_token_secret]
      }
      smtp.start(SMTP_HOST, @email_credentials[:email], secret, :xoauth) do |session|
        print "Sending message..."
        session.send_message(mail.encoded, mail.from_addrs.first, mail.destinations)
        puts ".sent!"
      end
    end
Use gmail_xoauth to send email