I'm trying to set a send an email script on my index.php page. As it happens I tried the following script that I found doing some search:
Code: Select all
<html>
<head>
<title>PHP Mail Array Loop</title>
</head>
<body>
<?php
$to = "somename@domain.com";
$subject = "Test mail";
$message = "Hello! This is a simple email message.";
$from = "anyname@space.com";
$headers = "From: $from";
mail($to,$subject,$message,$headers);
echo "Mail Sent.";
?>
</body>
</html>Instead of somename@domain.com and anyname@space.com I put real email addresses.
For some reason I'm not getting any email but just the "mail sent".
Now, since my php skills suck I'm turning to you to find some help.
Could anybody please tell me what I am doing wrong?