Unable To Send Any Mail
the warning massage is
Code:
Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing in C:\xampp\htdocs\Test\registrationcheck.php on line 37
the script for registrationcheck
Code:
<?php
include('DB_connect.php'); //connect to database
$name = strip_tags($_POST['name']);
$email = strip_tags($_POST['email']);
$password = strip_tags($_POST['password']);
$repeat_password = strip_tags($_POST['repeat-password']);
//test to see if name only contains letters
if(!preg_match(("[^A-Za-z ]"),$name))
{
//remember to make one for "too long name"
//check if email in use
$checkemailcommand="SELECT * FROM users WHERE email = '$email'";
$checkemailresult = mysql_query($checkemailcommand);
$num=mysql_num_rows($checkemailresult);
if($num==0){
//if passwords match up (should do it for email to but it ist done)
if($password==$repeat_password){
//we generate random code for confirmation email
$confirm_code=md5(uniqid(rand()));
//then we insert their info in a temporary database
$insertinfocommand="INSERT INTO temp SET code='$confirm_code', name = '$name', email = '$email', password = '$password'";
$insertinforesult=mysql_query($insertinfocommand);
//if the info is succsesfully entered temp, we are going to send an email
if($insertinforesult){
$message = "Your Confirmation link: \r\n http://localhost/test/confirmation.php?passkey=$confirm_code"; //link to the confirmation page where the var passkey is the same as their code
$sendmail = mail("$email","Redbook confirmation code","$message");
echo "confirmation link have been sent to your email ".$email;
}else{
echo "couldn't find your email in our database";
}
}else{
echo "password doesn't match";
//header("Location:passworddoesntmatch.html")
}
}else{
echo "email in use";
//header("Location:alreadyregistered.html");
}
}else{
echo "invalid name";
//header("Location:invalidname.html");
}
?>
I think i have to write in something about "From" where i tell where the email its sent from, don't really know if its right or not I am new at this
and how can you change the name of the thread??