I need a script that can upload several images to my server and send them to my email address, all controlled through a html form.
- simple form with name, email address to reply to, a field for an url and a message field.
- 10 fields for the uploads with browse button to select the files from the hard disk
- submit button
On submission, the script should do some basic checks of the form data.
***Also, the script must be secure.***
Only image files (jpg, jpeg, gif) should be allowed.
If there are errors, the script should display them on the same page. (Like in red a message above the email field that the email is not valid.)
If the submitted form data and the images are okay, the script should upload the images into a folder on the server.
Then the script should email the form data together with the files as an attachment to my email address.
The email address is to be hardcoded into the script, so that it cannot be used to send emails to other email addresses.
The uploaded images should be checked for their size. If they are too big (above 2MB), they get declined (with an error message for the user after the upload).
After the sending of the email was sucessful, the images should get deleted again from the server.