I need to enable the sending of mails by form. It is the first time I do it. I am based on this link:
link
I installed the mail server test tool to simulate a mail server:
link
With this, what I do is not send an email but "falsify" a shipment. By this I mean that the mail does not actually reach the recipient, but rather reaches a folder of the test mail server tool.
I have also configured the php.ini file of XAMPP to work with test mail server according to:
link
My code is very simple:
<?php
$mensaje = "Esto es una prueba";
if (mail('postmaster@localhost', 'prueba envio correo', $mensaje)) {
echo "email enviado con éxito";
} else{
echo "fallo de envío";
}
?>
When I run it, a success message appears, but nothing comes to the mail server test folder, so I need to know if the code works and why nothing comes to the folder.