mail inserts code updated