moved mailcontent function