mail javascript updated