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

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

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

This script is sending an email (to you@yourdomain.com) 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