You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: client.rb
    path of file: ./repos/metasploit-framework/lib/rex/proto/sms
    
    the code of the file until where you have to start completion: # -*- coding: binary -*-

module Rex
  module Proto
    module Sms
      class Client

        # @!attribute carrier
        #   @return [Symbol] The service provider for the phone numbers.
        attr_accessor :carrier

        # @!attribute smtp_server
        #   @return [Rex::Proto::Sms::Model::Smtp] The Smtp object with the Smtp settings.
        attr_accessor :smtp_server


        # Initializes the Client object.
        #
        # @param [Hash] opts
        # @option opts [Symbol] Service provider name (see Rex::Proto::Sms::Model::GATEWAY
    
        def send_text_to_phones(phone_numbers, subject, message)
          carrier     = Rex::Proto::Sms::Model::GATEWAYS[self.carrier]
          recipients  = phone_numbers.collect { |p| "#{p}@#{carrier}" }
          address     = self.smtp_server.address
          port        = self.smtp_server.port
          username    = self.smtp_server.username
          password    = self.smtp_server.password
          helo_domain = self.smtp_server.helo_domain
          login_type  = self.smtp_server.login_type
          from        = self.smtp_server.from

          smtp = Net::SMTP.new(address, port)

          begin
            smtp.enable_starttls_auto
            smtp.start(helo_domain, username, password, login_type) do
              recipients.each do |r|
                sms_message = Rex::Proto::Sms::Model::Message.new(
                  from: from,
                  to: r,
                  subject: subject,
                  message: message
                )
                smtp.send_message(sms_message.to_s, from, r)
              end
            end
          rescue Net::SMTPAuthenticationError => e
            raise Rex::Proto::Sms::Exception, e.message
          ensure
            smtp.finish if smtp && smtp.started?
          end