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

Version Path
SimBot-0.1.43 lib/mailer.rb
SimBot-0.1.42 lib/mailer.rb
SimBot-0.1.41 lib/mailer.rb
SimBot-0.1.40 lib/mailer.rb
SimBot-0.1.39 lib/mailer.rb
SimBot-0.1.38 lib/mailer.rb
SimBot-0.1.37 lib/mailer.rb
SimBot-0.1.36 lib/mailer.rb
SimBot-0.1.35 lib/mailer.rb
SimBot-0.1.34 lib/mailer.rb
SimBot-0.1.33 lib/mailer.rb
SimBot-0.1.32 lib/mailer.rb
SimBot-0.1.31 lib/mailer.rb
SimBot-0.1.30 lib/mailer.rb
SimBot-0.1.29 lib/mailer.rb
SimBot-0.1.28 lib/mailer.rb
SimBot-0.1.27 lib/mailer.rb
SimBot-0.1.26 lib/mailer.rb
SimBot-0.1.25 lib/mailer.rb
SimBot-0.1.24 lib/mailer.rb