def attach(file_or_files, filename = file_or_files.is_a?(File) ? File.basename(file_or_files.path) : nil,
      type = nil, headers = nil)
      if file_or_files.is_a?(Array)
        file_or_files.each do |v|
      	  if v.length < 2
      	    v << v.first.is_a?(File) ? File.basename(v.first.path) : nil
      	  end
      	  @mail.add_attachment_as *v
      	end
      else
        if !file_or_files.is_a?(File) && !file_or_files.is_a?(StringIO)
          raise ArgumentError, "You did not pass in a file. Instead, you sent a #{file_or_files.class}" 
        end
        @mail.add_attachment_as(file_or_files, filename, type, headers)
      end
    end
def attach(file_or_files, filename = file_or_files.is_a?(File) ? File.basename(file_or_files.path) : nil,
      type = nil, headers = nil)
      if file_or_files.is_a?(Array)
        file_or_files.each do |v|
      	  if v.length < 2
      	    v << v.first.is_a?(File) ? File.basename(v.first.path) : nil
      	  end
      	  @mail.add_attachment_as *v
      	end
      else
        if !file_or_files.is_a?(File) && !file_or_files.is_a?(StringIO)
          raise ArgumentError, "You did not pass in a file. Instead, you sent a #{file_or_files.class}" 
        end
        @mail.add_attachment_as(file_or_files, filename, type, headers)
      end
    end
==== 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.

 ==== Raises
 ArgumentError::
   file_or_files was not a File or an Array of File instances.