Jump to content

Not recieving the confirmation email


Lone_Ranger
Go to solution Solved by Lone_Ranger,

Recommended Posts

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");
 }
}

 }
}
?>
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.