Send Email from a PHP Script

you use the mail() function (in combination with a web form in particular), make sure you check it is called from the desired page and protect the form with a CAPTCHA

mail(to,subject,message,headers,parameters);

<?php
$to = "someone@test.com";
$subject = "Test mail";
$message = "Hello! This is a simple email test.";
$from = "someonelse@test.com";
$headers = "From:" . $from;
mail($to,$subject,$message,$headers);
echo "Sent.";
?>


The  mail() function is used to send emails.