all mail functions working