Sha256: 921f41773acd64b588afbbe58d6abbf00c8202ea4e7aa6c9c2bc5e0804ba6264
Contents?: true
Size: 755 Bytes
Versions: 24
Compression:
Stored size: 755 Bytes
Contents
class Mailer require 'mail' def initialize(username, password) @username = username @password = password end def send(to_, cc_, from_, subject_, body_) options = {:address => "smtp.gmail.com", :port => 587, :user_name => @username, :password => @password, :authentication => 'plain', :enable_starttls_auto => true} mail = Mail.new do delivery_method :smtp, options to to_ cc cc_ from from_ subject subject_ end html_part = Mail::Part.new do content_type 'text/html; charset=UTF-8' body "#{body_}\n #{File.read('email_footer.html')}" end mail.html_part = html_part mail.deliver end end
Version data entries
24 entries across 24 versions & 1 rubygems