Lone_Ranger Posted December 31, 2013 Share Posted December 31, 2013 I followed a tutorial and the registration form works great, all the data goes into the database and everything registers fine but there is one problem the verification email whilst it says has been sent never arrives to the email account. Why is this? I use my hosting off Godaddy <?php include('config.php'); if ($_POST['name'] == "" || $_POST['username'] == "" || $_POST['password'] == "") { include('top.php'); echo "<p align=center><font size=2>Hey MCFLY! You left some field's blank so you haven't registered! <a href=http://www.sentuamessage.com/register.php>Click Here</a> to retry.</font></p>"; include('bottom.php'); } else { $namecheck = mysql_query("select * from userdb where name='$_POST[name]'"); if(@mysql_numrows($namecheck) > 0) { include('top.php'); echo "<font size=2><p align=center>font color=red>Error:</font></b>: That name is already taken</p> <p>Please try your <a href=http://www.sentuamessage.com/register.php>registry again</a></font>."; include('bottom.php'); } else { $emailcheck = mysql_query("select * from userdb where username='$_POST[username]'"); if(@mysql_numrows($emailcheck) > 0) { include('top.php'); echo "<font size=2><p align=center>font color=red>Error:</font></b>: That email address is already taken</p> <p>Please try your <a href=http://www.sentuamessage.com/register.php>registry again</a></font>."; include('bottom.php'); } else { $tbl_name=temporaryuserdb; $confirm_code=md5(uniqid(rand())); $name=$_POST['name']; $username=$_POST['username']; $password = md5($_POST['password']); $country=$_POST['location']; $gender=$_POST['gender']; $sql="INSERT INTO $tbl_name(confirm_code, name, username, password, country, gender)VALUES('$confirm_code', '$name', '$username', '$password', '$country', '$gender')"; $result=mysql_query($sql); if($result){ // ---------------- SEND MAIL FORM ---------------- $to=$username; $subject="SentUAMessage - Verify Account"; $header="from: SentUAMessage <customerservice@sentuamessage.com>"; $message="<div align=center> <table border=1 width=30% cellspacing=0 cellpadding=0 bordercolor=#000000> <tr> <td> <table border=0 width=100% cellspacing=0 cellpadding=0> <tr> <td bgcolor=#008000 height=5></td> </tr> <tr> <td><img src=http://www.sentuamessage.com/emailheader.jpg></img></td> </tr> <tr> <td bgcolor=#008000 height=5></td> </tr> </table> </td> </tr> </table> </div> <div align=center> <table border=0 width=51% cellspacing=0 cellpadding=0> <tr> <td> </td> </tr> <tr> <td> <table border=1 width=100% cellspacing=0 cellpadding=0 bordercolor=#000000> <tr> <td> <table border=0 width=100% cellspacing=0 cellpadding=0> <tr> <td><img src=http://www.sentuamessage.com/emailheadertop.jpg></img></td> </tr> <tr> <td> <h3 align=center><b>Your Confirmation Link</b></h3> <table border=0 width=100% cellspacing=0 cellpadding=0> <tr> <td width=6> </td> <td><p>Click on this link to activate your account:</p>"; $message.="http://www.sentuamessage.com/regconfirmation.php?passkey=$confirm_code"; $message="</td> <td width=6> </td> </tr> </table> </td> </tr> </table> </td> </tr> </table> </td> </tr> </table> </div>"; $sentmail = mail($to,$subject,$message,$header); } else { include("top.php"); echo "<font size=2><p align=center>Not found your email in our database</p></font>"; include("botton.php"); } if($sentmail){ include("top.php"); echo "<font size=2><p align=center>Your Confirmation link Has Been Sent To Your Email Address.</p></font>"; include("bottom.php"); } else { include("top.php"); echo "<font size=2><p align=center>Cannot send Confirmation link to your e-mail address</p></font>"; include("bottom.php"); } } } } ?> Quote Link to comment https://forums.phpfreaks.com/topic/285008-not-recieving-the-confirmation-email/ Share on other sites More sharing options...
adam_bray Posted December 31, 2013 Share Posted December 31, 2013 Have you checked spam/junk folders? Quote Link to comment https://forums.phpfreaks.com/topic/285008-not-recieving-the-confirmation-email/#findComment-1463434 Share on other sites More sharing options...
dalecosp Posted December 31, 2013 Share Posted December 31, 2013 Mail delivery isn't guaranteed. Have you tried sending it to several different receiving addresses on different servers/services? Spammers have made "guaranteeing" mail-delivery much harder than it used to be.... Quote Link to comment https://forums.phpfreaks.com/topic/285008-not-recieving-the-confirmation-email/#findComment-1463435 Share on other sites More sharing options...
Lone_Ranger Posted December 31, 2013 Author Share Posted December 31, 2013 guess I can try more and wait longer to see if it is something that is just delayed. Quote Link to comment https://forums.phpfreaks.com/topic/285008-not-recieving-the-confirmation-email/#findComment-1463437 Share on other sites More sharing options...
dalecosp Posted December 31, 2013 Share Posted December 31, 2013 Make sure you have a Reply-To; that might help you get the "I couldn't send this" responses from the system(s). Quote Link to comment https://forums.phpfreaks.com/topic/285008-not-recieving-the-confirmation-email/#findComment-1463438 Share on other sites More sharing options...
tqla Posted December 31, 2013 Share Posted December 31, 2013 With godaddy I believe the "from" email has to actually exist. Quote Link to comment https://forums.phpfreaks.com/topic/285008-not-recieving-the-confirmation-email/#findComment-1463441 Share on other sites More sharing options...
Lone_Ranger Posted December 31, 2013 Author Share Posted December 31, 2013 my FROM address does exist to be fair Quote Link to comment https://forums.phpfreaks.com/topic/285008-not-recieving-the-confirmation-email/#findComment-1463442 Share on other sites More sharing options...
Solution Lone_Ranger Posted December 31, 2013 Author Solution Share Posted December 31, 2013 got it working, basically the second one $message tag I messed up it should have been $message "html"; $message. "html"; $message."html"; not $message "html"; $message."html"; $message "html"; Quote Link to comment https://forums.phpfreaks.com/topic/285008-not-recieving-the-confirmation-email/#findComment-1463443 Share on other sites More sharing options...
tqla Posted December 31, 2013 Share Posted December 31, 2013 Are you replacing customerservice@sentuamessage.com with a real email address? Quote Link to comment https://forums.phpfreaks.com/topic/285008-not-recieving-the-confirmation-email/#findComment-1463444 Share on other sites More sharing options...
Lone_Ranger Posted December 31, 2013 Author Share Posted December 31, 2013 the Customerservice email address is a real email address Quote Link to comment https://forums.phpfreaks.com/topic/285008-not-recieving-the-confirmation-email/#findComment-1463445 Share on other sites More sharing options...
tqla Posted December 31, 2013 Share Posted December 31, 2013 so your issue was concatenation. glad you got it working. Quote Link to comment https://forums.phpfreaks.com/topic/285008-not-recieving-the-confirmation-email/#findComment-1463446 Share on other sites More sharing options...
Lone_Ranger Posted December 31, 2013 Author Share Posted December 31, 2013 yea only thing im looking at now is how to get the HTML to show as a layout instead of script when the email is sent Quote Link to comment https://forums.phpfreaks.com/topic/285008-not-recieving-the-confirmation-email/#findComment-1463449 Share on other sites More sharing options...
dalecosp Posted December 31, 2013 Share Posted December 31, 2013 You must set the proper MIME type and format the message with a "unique" separator field to get HTML email. Quote Link to comment https://forums.phpfreaks.com/topic/285008-not-recieving-the-confirmation-email/#findComment-1463451 Share on other sites More sharing options...
Lone_Ranger Posted December 31, 2013 Author Share Posted December 31, 2013 so if I did $header.="MIME-VERSION: 1.02 $header.="content-type= text/html; charset=UTF-8"; should resolve it Quote Link to comment https://forums.phpfreaks.com/topic/285008-not-recieving-the-confirmation-email/#findComment-1463495 Share on other sites More sharing options...
Lone_Ranger Posted December 31, 2013 Author Share Posted December 31, 2013 guys thank you. It's working Quote Link to comment https://forums.phpfreaks.com/topic/285008-not-recieving-the-confirmation-email/#findComment-1463497 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.