Sha256: a881c7914238d260e96883754ba4a516c1d81fd5903204707549f9ab2efe9687
Contents?: true
Size: 836 Bytes
Versions: 43
Compression:
Stored size: 836 Bytes
Contents
module Helper class Mail attr_accessor :smtp_host attr_accessor :smtp_port def initialize smtp_host = 'localhost' if not smtp_host smtp_port = 25 if not smtp_port end def sendmail(options={}) begin Pony.mail( \ :from => options[:from], :to => options[:to], :via => :smtp, :via_options => { :address => smtp_host, :port => smtp_port, :authentication => nil, :enable_starttls_auto => false }, :subject => options[:subject], :body => options[:body] ) rescue Exception => e $log.writer.error "Can not send mail via host #{smtp_host}" $log.writer.error e.message end end end end
Version data entries
43 entries across 43 versions & 1 rubygems