Improved mail script