i'm having problems with this function in a class that is called to insert a new user into the database, 'cause it inserts the user but it doesn't send the email confirmation.
what's wrong with this?
// inserts a new user
function insertUser($email, $password, $name, $address, $zip_code, $zip_code2, $city, $phone, $num_cont) {
$sql = "INSERT INTO user VALUES ('$email', '$password', '$name', '$address', '$zip_code', '$zip_code2', '$city', '$phone', '$num_cont')";
if($this->bd->executeSQL($sql)) {
return true;
$message = "Wellcome to Infor Ever - Online. \r\n\r\n Please keep this email for your safety. \r\n\r\n Your login is this: \r\n\r\n---------------------------- \r\n Username: $email \r\n Password: $password \r\n---------------------------- \r\n Thanks for registering.";
mail($email, "Wellcome to Infor Ever - Online", $message, "From: Infor Ever - Online");
} else {
return false;
}
}
is it a problem the mail being in the same function? how to solve this?
thanks