Module: Rango::Mailing

Defined in:
lib/rango/mailer.rb

Instance Method Summary collapse

Instance Method Details

#mail(to, from, subject, &block) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
# File 'lib/rango/mailer.rb', line 14

def mail(to, from, subject, &block)
  Mail.deliver do |mail|
    mail.to = to
    mail.from = from
    mail.subject = subject
    mail.body = block.call
    puts self
  end
rescue Errno::ECONNREFUSED
  Rango.logger.error("E-mail from #{caller[0]} can't be send due to refused connection to the SMTP server")
end