Hi! Interesting project! I would love to do a javascript script to so that for you.
Do you have the API which will receive the emails? Or that need to be developed as well? Also the db with schema is in place?
If you don't have anything, it would require more than simple script. Would require an API development and db as well.
The script can be done in a few hours. The API and db - in about 5days, depending on your server structure.
Thank you,
Ioan