code: def multipart_content(*files):
      
      outer = MIMEMultipart()
      for fname in files:
          mtype = get_type(fname)
          maintype, subtype = mtype.split('/', 1)
          with open(fname) as f:
              msg = MIMEText(f.read(), _subtype=subtype)
          msg.add_header('Content-Disposition', 'attachment', 
                         filename=os.path.basename(fname))
          outer.attach(msg)
      return outer.as_string()
docs: Returns a mutlipart content.
      Note:
        This script was clearly inspired by write-mime-multipart.