adding mail logging