def attach( file_or_files, filename = file_or_files.is_a?(File) ? File.basename(file_or_files.path) : nil,
      type = nil, headers = nil)
      @mailer.attach(file_or_files, filename, type, headers)
    end
def attach( file_or_files, filename = file_or_files.is_a?(File) ? File.basename(file_or_files.path) : nil,
      type = nil, headers = nil)
      @mailer.attach(file_or_files, filename, type, headers)
    end
Attaches a file or multiple files to an email. You call this from a
 method in your MailController (including a before filter).

 ==== Parameters
 file_or_files<File, Array[File]>:: File(s) to attach.
 filename<String>::
 type<~to_s>::
   The attachment MIME type. If left out, it will be determined from
   file_or_files.
 headers<String, Array>:: Additional attachment headers.

 ==== Examples
   attach File.open("foo")
   attach [File.open("foo"), File.open("bar")]

 If you are passing an array of files, you should use an array of the
 allowed parameters:

   attach [[File.open("foo"), "bar", "text/html"], [File.open("baz"),
     "bat", "text/css"]

  which would attach two files ("foo" and "baz" in the filesystem) as
 "bar" and "bat" respectively. It would also set the mime-type as
 "text/html" and "text/css" respectively.