0

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.

Alphadark4
  • 31
  • 6
  • If you are on a commercial ISP they may be blocking it (Port 25 is commonly blocked). Not sure why it would work and then stop though. Is there anything useful in /var/log/maillog? – Nathan Apr 29 '15 at 16:04
  • Thanks @Nathan I had a look at the log and I have seen what is causing the issue. There is a line which is being constantly repeated that says $ecureserver.net [ip address] refused to talk to me. – Alphadark4 Apr 30 '15 at 07:54

0 Answers0