Here is a script example you can test php mail function with:

$to = "";
$subject = "Hi!";
$body = "TEST";
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type:text/html;charset=UTF-8\r\n";
$headers .= "From: You <>\r\n";

if(mail($to,$subject,$body,$headers)) {
echo "MAIL - OK";
} else {

This script is sending an email (to and printing “MAIL – OK” on the page.

Tip: Please note that the ‘From’ header should be an existing email account inside your Email Manager of your Hosting Control Panel.

Keep reading