Assuming the file is uploaded (and handled) by WordPress, you will need to hook to
$update will be passed to your custom function. You can use those to check if the post is a new file upload (attachment).
I am not a specialist in php. So I didn’t understand where past this code and if I need to personnalize the code. I tried to past it in post.php (changing the email) but it doesn’t work.
Maybe is there a plugin which handle this ?