Thread:Project:Support desk/Sending attachments via contact form (emailForm) (2)/reply (2)

First, you would need to upload the file. See includes/specials/SpecialUpload.php for code that you will have to copy and adapt for that.

Next, you'll have to fetch the file that someone has uploaded. See WebRequest::getFileTempname and other functions in includes/WebRequest.php for that.

Finally, you'll have to attach the file to your email. As far as I know, there isn't a core function of MediaWiki that does this. After poking around on packagist to find something you could use, it looks like this mime-mailer would be something you could use.