added upload and email send functionality