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


$to = "";
$subject = "Test mail";
$message = "Hello! This is a simple email test.";
$from = "";
$headers = "From:" . $from;
echo "Sent.";

The  mail() function is used to send emails.