I am trying to send emails from PHP code, the emails are not sending out. I have checked port 25 and it doesn't looked blocked from the server side
I am hosting my Site on Windows Server 2019 and using IIS I have found this code to test the PHP mail function and I am getting Error Msg
<?PHP
$sender = '****@e-****.co.za';
$recipient = '****@e-*****.co.za';
$subject = "php mail test";
$message = "php test message";
$headers = 'From:' . $sender;
if (mail($recipient, $subject, $message, $headers))
{
echo "Message accepted";
}
else
{
echo "Error: Message not accepted";
}
?>
Error: Message not accepted
I have PHP Version 7.2.26 installed and it is working correctly
How else can I check what would be blocking SMTP messages being sent