added new email function and basic ajax