Class: OAI::Harvester::Mailer

Inherits:
Object
  • Object
show all
Defined in:
lib/oai/harvester/mailer.rb

Class Method Summary collapse

Class Method Details

.send(server = nil, email = nil, message = nil) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/oai/harvester/mailer.rb', line 6

def self.send(server = nil, email = nil, message = nil)
  msg = %{Subject: Harvester Summary\n\n#{message.join("\n")}}
  to = (email.map { |e| "'#{e}'"}).join(", ")
  Net::SMTP.start(server) do |smtp|
    smtp.send_message msg, "harvester@#{Socket.gethostname}", to
  end
end