Class: Net::SMTP

Inherits:
Object show all
Defined in:
lib/more/facets/smtp_tls.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.start(address, port = nil, helo = 'localhost.localdomain', user = nil, secret = nil, authtype = nil, use_tls = false, &block) ⇒ Object



44
45
46
47
48
49
# File 'lib/more/facets/smtp_tls.rb', line 44

def self.start( address, port = nil,
                helo = 'localhost.localdomain',
                user = nil, secret = nil, authtype = nil, use_tls = false,
                &block) # :yield: smtp
  new(address, port).start(helo, user, secret, authtype, use_tls, &block)
end

Instance Method Details

#start(helo = 'localhost.localdomain', user = nil, secret = nil, authtype = nil, use_tls = false) ⇒ Object



53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/more/facets/smtp_tls.rb', line 53

def start( helo = 'localhost.localdomain',
           user = nil, secret = nil, authtype = nil, use_tls = false ) # :yield: smtp
  start_method = use_tls ? :do_tls_start : :do_start
  if block_given?
    begin
      send start_method, helo, user, secret, authtype
      return yield(self)
    ensure
      do_finish
    end
  else
    send start_method, helo, user, secret, authtype
    return self
  end
end

#tls_old_startObject



51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/more/facets/smtp_tls.rb', line 51

def start( helo = 'localhost.localdomain',
           user = nil, secret = nil, authtype = nil, use_tls = false ) # :yield: smtp
  start_method = use_tls ? :do_tls_start : :do_start
  if block_given?
    begin
      send start_method, helo, user, secret, authtype
      return yield(self)
    ensure
      do_finish
    end
  else
    send start_method, helo, user, secret, authtype
    return self
  end
end