added authentication to mail task