For the past 2 days I\'ve been trying to get a PHP script to send an e-mail and it doesn\'t seem to work. First I\'ve tried the normal php mail function, then PHPMailer and then
The SMTPOptions line in @David Kariuki's solution fixed my issue. Was getting a SMTP connect failure due to the failure in the TLS handshake.
$mail->SMTPOptions = array( 'ssl' => array( 'verify_peer' => false, 'verify_peer_name' => false, 'allow_self_signed' => true ) );