code: def add_attachment(self, file_path, mimetype=None):
          
          if not mimetype:
              mimetype, _ = mimetypes.guess_type(file_path)
  
          if mimetype is None:
              mimetype = 'application/octet-stream'
  
          type_maj, type_min = mimetype.split('/')
          with open(file_path, 'rb') as fh:
              part_data = fh.read()
  
              part = MIMEBase(type_maj, type_min)
              part.set_payload(part_data)
              email_encoders.encode_base64(part)
  
              part_filename = os.path.basename(self._encoded(file_path))
              part.add_header('Content-Disposition', 'attachment; filename="%s"'
                              % part_filename)
  
              self._parts.append((mimetype, part))
docs: Attaches a file located at *file_path* to the envelope. If
          *mimetype* is not specified an attempt to guess it is made. If nothing
          is guessed then `application/octet-stream` is used.