Thursday, June 12, 2014

Test PHP mail function




testmail.php to test PHP mail function:
<?php
ini_set('error_reporting', E_ALL);
?>
<html>
<head>
<title>PHP: Test mail function</title>
</head>
<body>
<?php
$email = "jiansen@example.com";
$subject = "Happy Birthday!";
$msg = "Wishing you all the best in life.";
echo $subject;
$headers = "From: jiansen@example.com";
$headers .= "Reply-To: jiansen@example.com";
if(mail($email,$subject,$msg, $headers)){
     echo "E-Mail Sent";
} else {
     echo "There was a problem";
}
?>
</body>
</html>

No comments:

Post a Comment