I have the lamp stack set up on a Centos 7 server, I have a couple of PHP scripts that send mail to various different mail addresses.
This worked until last week, now none of the mail gets through I have tried disabling the firewall and other security options however the mail still wont send, I do not receive any errors and all of my validation works fine.
I am currently using this in the /var/www/html root of my server.
<?php
$to = "email";
$header = "From: {$to}";
$subject = "Subject";
$body = "Some Text.";
if (mail($to, $subject, $body, $header)) {
echo ("Sent");
} else {
echo("Failed");
}
?>
The above always echo's sent to the browser.
I have searched for various solutions to this but haven't had any luck so far, is there anything anyone could suggest?
This is not a duplicate because my server WAS sending mail up till last week without issue unlike the example that was posted.
EDIT: I have looked in my maillog and have the line $ecureserver.net [ip address] refused to talk to me.