Class: Net::SMTP

Inherits:
Object
  • Object
show all
Defined in:
lib/ar_mailer_rails3/ar_sendmail.rb,
lib/smtp_tls.rb

Overview

:stopdoc:

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



15
16
17
18
19
20
# File 'lib/smtp_tls.rb', line 15

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

#resetObject

Resets the SMTP connection.



15
16
17
# File 'lib/ar_mailer_rails3/ar_sendmail.rb', line 15

def reset
  getok 'RSET'
end

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



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/smtp_tls.rb', line 24

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



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/smtp_tls.rb', line 22

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