I am trying to send an email using php
mail()
function. Its returns true but not sending mail and showing following.
The description for Event ID 2 from source PHP-7.2.2
cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.
If the event originated on another computer, the display information had to be saved with the event.
I am using Windows server
<?php
$to = 'myemail@gmail.com';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: myemail1@gmail.com' . "\r\n" .
'Reply-To: myemail@gmail.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
$result = mail($to, $subject, $message, $headers);
var_dump($result);
?>
The script should send an email to myemail@gmail.com