Updated to PHPMailer 5.2.7 and code improvements