lib/ronin/network/smtp/smtp.rb in ronin-support-0.4.1 vs lib/ronin/network/smtp/smtp.rb in ronin-support-0.5.0.rc1
- old
+ new
@@ -34,11 +34,11 @@
# @return [Integer]
# The default Ronin SMTP port.
#
# @api public
#
- def SMTP.default_port
+ def self.default_port
@default_port ||= DEFAULT_PORT
end
#
# Sets the default Ronin SMTP port.
@@ -46,11 +46,11 @@
# @param [Integer] port
# The new default Ronin SMTP port.
#
# @api public
#
- def SMTP.default_port=(port)
+ def self.default_port=(port)
@default_port = port
end
#
# Creates a properly formatted email.
@@ -67,11 +67,11 @@
#
# @see SMTP::Email
#
# @api public
#
- def SMTP.message(options={},&block)
+ def self.message(options={},&block)
Email.new(options,&block).to_s
end
#
# Creates a new email message.
@@ -134,14 +134,13 @@
#
def smtp_connect(host,options={})
host = host.to_s
port = (options[:port] || SMTP.default_port)
- helo = options[:helo]
-
- auth = options[:auth]
- user = options[:user]
+ helo = options[:helo]
+ auth = options[:auth]
+ user = options[:user]
password = options[:password]
session = Net::SMTP.start(host,port,helo,user,password,auth)
yield session if block_given?
@@ -204,10 +203,10 @@
# :from => 'eve@example.com',
# :subject => 'Hello',
# :message_id => 'XXXX',
# :body => 'Hello'
#
- # @example Using the block.
+ # @example Using the block:
# smtp_send_message('www.example.com') do |email|
# email.to = 'joe@example.com'
# email.from 'eve@example.com'
# email.subject = 'Hello'
# email.message_id = 'XXXXXXXXXX'