function mailsender and fixed some bugs 19:58