How can I send an email using PHP? Example code - Biz Tech

How can I send an email using PHP? Example code

Listen
$to = "youremail@example.com";
$subject = "Test email";
$message = "This is a test email sent from PHP";
$headers = "From: yourname@example.com\r\n" .
           "Reply-To: yourname@example.com\r\n" .
           "X-Mailer: PHP/" . phpversion();

mail($to, $subject, $message, $headers);
echo "Email sent";