Hi all, this is my first post and would appreciate some insight as to where im going wrong.
I have the following form that successfully registers a new user to my mysqsl database via PHP - with the following $sql INSERT Function
The problem im having is sending the activation \ confirmation email to the new users email address.
//email function
ini_set("SMTP", "smtp.server.com");//confirm smtp
$to=$email;
// Your subject
$subject="activation required";
// From
$header="from: test email <Test@test.com>";
// Your message
$message="Your Comfirmation link\r\n";
$message.="Click on this link to activate your account\r\n";
$message.="You can not login to your new account until you have confirmed your activation\r\n";
$message.="http://test.com/activation-confirmation.php?passkey=$securecode";
// send email
$sentmail = mail($to,$subject,$message,$header);
//Create INSERT query
$qry = "INSERT INTO members3t(securecode, firstname, lastname, login, passwd, email, mobnum,country,city,datetime,uipa,ref,browser,sms) VALUES('$securecode','$fname','$lname','$login','".md5($_POST['password'])."','$email','$mobnum','$country','$city','$datetime','$uipa','$ref','$browser','$sms')";
$result = @mysql_query($qry);
//add sms code here -
//add send to email -
//Check whether the query was successful or not
if($result) {
header("location: register-success.php");
exit();
}else {
die("Query failed2");
}
?>
If i could get a reply on this and some points to learn from I would be very much appreciated,
Regards
Lloyd