how can sending email in php

how can sending email in php


mail() function using for email sending in php

<?php
$from="test@gmail.com";
$to="to@gmail.com";
$subject="Test Mail";
$message="Hi ,<br />".
"test mail <br />".
"Thank You";
$headers = "From: $from\r\nContent-type: text/html";
if(mail($to,$subject, $message, $headers))
{
echo "MAIL SENT SUCCESSFULLY";
}
else
{
echo "SOME ISSUE WITH MAIL SENDING in SERVER";
}
?>