Updated form processing, implemented sending of emails