I have the following code to test if the website can send mail via php:
<?php
ini_set( 'display_errors', 1 );
error_reporting( E_ALL );
$from = "emailtest@YOURDOMAIN";
$to = "YOUREMAILADDRESS";
$subject = "PHP Mail Test script";
$message = "This is a test to check the PHP Mail functionality";
$headers = "From:" . $from;
mail($to,$subject,$message, $headers);
echo "Test email sent";
?>
I have uploaded this php file to www.mywebsite.com/data/iq/testing-email.php
when I run the script I get the following error:
Warning: mail(): Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\mywebsite.com\data\iq\test-email.php on line 9
My question is why is the error showing a C:\ file directory when the website is already live?
For reference this website is running on a Microsoft IIS Server and has an SSL if that makes any difference.