def METHOD_NAME(self, path):
    check_readable(path)
    with open(path, "rb") as f:
        contents = f.read()
        f.close()
    mime = guess_type(path, strict=False)[0]
    # MIME fallback
    if not mime:
        mime = "application/octet-stream"
    if self._debug:
        logger.debug("Filename:\t{}\nMIME-type:\t{}".format(path_leaf(path), mime))
    self._attachment = "data:" + mime + ";base64," + b64encode(contents).decode()
    self._attachment_name = path_leaf(path)