With E2EE I don't think you can even implement a reliable export on the server side.
It seems like Element is limited to only exporting a single room, though. You need something like https://gitlab.com/argit/matrix-recorder/ to export all messages, it seems.
The client would have to fetch all your messages first. Some rooms can have thousands of messages a day, and some people are in thousands of rooms [1] (though these are core developers so they might be stress testing)
it has if the the person who you are chatting with didn't already delete their comment (unless you host your own server and modified it to keep a log of everything)