I was using friday.mxlogin.com host till now which was cpanel. I have been migrated to shadow.mxrouting.net which is DIrectAdmin. But since then I am not able to send mail via phpMailer. Below is the code i use :
$mail->SMTPDebug = SMTP::DEBUG_SERVER; // Enable verbose debug output $mail->isSMTP(); // Send using SMTP $mail->Host = 'shadow.mxrouting.net'; // Set the SMTP server to send through $mail->SMTPAuth = true; // Enable SMTP authentication $mail->Username = 'email@example.com'; // SMTP username $mail->Password = '********'; // SMTP password $mail->SMTPSecure = PHPMailer::ENCRYPTION_SMTPS; // Enable TLS encryption; `PHPMailer::ENCRYPTION_SMTPS` encouraged $mail->Port = 465; // TCP port to connect to, use 465 for `PHPMailer::ENCRYPTION_SMTPS` above $mail->setFrom('firstname.lastname@example.org', 'myemail'); $mail->addAddress('email@example.com', 'toemail'); // Add a recipient $mail->isHTML(true); // Set email format to HTML $mail->Subject = 'Test subject 2'; $mail->Body = 'This is the HTML message body <b>in bold!</b>'; $mail->send();
This used to work perfectly with the earlier host friday(dot)mxlogin(dot)com however now i am getting following error :
“2021-01-31 12:10:53 SMTP ERROR: Failed to connect to server: Connection timed out (110) SMTP connect() failed.”
My IP is not blocked as i am able to send mails via other mailing system on this host itself without any issue.
I have tried changing to port 587 with PHPMailer::ENCRYPTION_STARTTLS but the result is the same. I also tried this with several different servers/ vps but the result is always the same.
Can anyone help??