added mail functionality (but seems not working)