Thursday, August 9, 2007

Sending mail with mail()

<?

$email = "webmaster@yourwebsite.net"; // Recieve this by your email adress
$subject = "My Test Subject"; // Replace this by a subject
$message = "This is a test message"; // Replace this by your message
$header = "From: Webmaster@" . $_SERVER['SERVER_NAME'] . "\r\n";

if (mail($email, $subject, $message, $headers)) {
$report = "Your email has been send";
} else {
$report = "Your email could not be send";

echo "<b>$report</b>";

?>

No comments: