My sites were migrated to a new server this week and since the move the PHP Mailer class has stopped working. I get the following error:
Fatal error: Uncaught exception 'phpmailerException' with message 'SMTP Error: Could not connect to SMTP host
My settings are as follows:
$mail->Host = 'mail.mydomain.com';
$mail->SMTPAuth = true;
$mail->Port = 587;
$mail->Username = 'email@example.com';
$mail->SMTPSecure = 'tls';
I have tried port 25 as well as 587.
Before migration this worked fine for several years.