Sha256: 8a887b4eb3f522c3a735d5c07b6b997148ed4dd90cecb2c2d07dfb28ea3fb5a0

Contents?: true

Size: 1.12 KB

Versions: 6

Compression:

Stored size: 1.12 KB

Contents

class Mailer < ActionMailer::Base
  def multipart
    @recipients = "mutoh@highway.ne.jp"
    @from = "mutoh@highway.ne.jp"
    @subject = _("multipart test mail")
    @sent_on = Time.gm("2007-01-01 00:00:00")
    @mime_version = "1.0"
    @body = nil
    @charset = nil
    @content_type = "multipart/mixed"

    attachments = Dir.glob("#{RAILS_ROOT}/public/images/*").select{|f| File.file?(f)}

    part(:content_type => "text/plain", :charset => "iso-2022-jp") do |coverpage|
      coverpage.body = render_message("coverpage", :name => "foo")
      coverpage.transfer_encoding = "7bit"
    end

    attachments.each do |attachment|
      attachment "application/octet-stream" do |attach|
        attach.content_disposition = "attachment"
        attach.charset = nil
        attach.filename = File.basename(attachment)
        attach.transfer_encoding = "base64"
        attach.body = File.read(attachment)
      end
    end
    @body
  end

  def singlepart
    recipients "mutoh@highway.ne.jp"
    from "mutoh@highway.ne.jp"
    subject _("singlepart test mail")
    sent_on Time.gm("2007-01-01 00:00:00")
    body["name"] = "foo"
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
gettext-1.10.0-mswin32 test/rails/app/models/mailer.rb
gettext-1.10.0 test/rails/app/models/mailer.rb
gettext-1.92.0 test/rails/app/models/mailer.rb
gettext-1.91.0 test/rails/app/models/mailer.rb
gettext-1.90.0 test/rails/app/models/mailer.rb
gettext-1.93.0 test/rails/app/models/mailer.rb