I'm trying to implement a PHP mail function in my aws Windows Server 2016 but after using PHP mail function mail is not received:
<?php
ini_set();
$to = "km.kuldeepmourya@gmail.com";
$subject = "My subject";
$txt = "Hello world!";
$headers = "From: webmaster@example.com" . "\r\n" .
"CC: somebodyelse@example.com";
$check=mail($to,$subject,$txt,$headers);
if($check)
echo"mail sent";
else
echo"mail not sent";
?>
Output:
Warning: ini_set() expects exactly 2 parameters, 0 given in
C:\xampp\htdocs\mymail.php on line 2
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:\xampp\htdocs\mymail.php on line 9 mail not sent