added mail functionality