I have a quantity of files with a numeric.pdf reference e.g. 4010606.pdf. Information on the contents is listed in an html table made searchable with a simple .js library.

Stage 1.
I would like to be able to click on them which then attaches them to an email. This would be sent to one or more recipents. Their eml address can be typed in.

Stage 2.
I would like to record information such as date, time, recipient, docs attached etc.

Is javascript enabled for eml or is there a better language?
If there is a way to do what I need could you help me please?