Web Hosting News, Web Hosting Tips, Web Hosting Tutorials and FAQ by AwardSpace.com
AwardSpace Blog » Posts for tag 'send mail example'

I am unable to use PHP mail() function from my paid hosting account, why? No comments yet

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

<?
$from = “From: You <you@yourdomain.com>”;
$to = “you@yourdomain.com”;
$subject = “Hi! “;
$body = “TEST”;

if(mail($to,$subject,$body,$from))
echo “MAIL – OK”;
else
echo “MAIL FAILED”;
?>

This script is sending email (to you@yourdomain.com) and printing “MAIL – OK” on the page.

Please note that the ‘from’ header should be an existing email account inside your Email Manager of your hosting Control Panel.

Top of page / Subscribe to new Entries (RSS)