added mail functionality
fixed mail functionality