added mail helper function