mail functionality update