Hi all,
I am a newbie in php and is developing a cms. I am verifying the email address of the new user when creating an account on a site. The email goes to the email address with activation code of the account, but this email is not having the design i have given to it. I have designed it like a newsletter and created a small HTML of it. But this HTML email is sending the HTML tags which i have given in the '$message' variable. Rather it should be in a design not the HTML tags.
I am sending you the code, please check and tell me where i am going wrong. The code goes below:-
<?php
$link = "http://www.multisoftintl.com/php/confirmation.php?passkey=$confirm_code";
// send e-mail to ...
$to = $email;
// Subject
$subject="Your confirmation link here";
// From
$headers = "from: your name <your email>";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
// Message
$message = '<html><body>';
$message .= '<table width="587" border="0" cellspacing="0" cellpadding="0" align="center" >\r\n';
$message .= '<tr><td width="564" height="88" align="center" bgcolor="#3E709E"><a href="http://multisoftintl.com"><img src="images/logo.gif" width="330" height="88" alt="Multisoft International"/></a></td></tr>\r\n';
$message .= '<tr><td height="32" align="center" background="images/hover_bg.gif"><font face="Verdana, Arial, Helvetica, sans-serif" color="#FFFFFF"><b>Your Comfirmation link From Multisoft International</b></font></td></tr>\r\n';
$message .= '<tr><td><font face="Verdana, Arial, Helvetica, sans-serif" color="#666666"><h4>Hi,</td></tr>\r\n';
$message .= '<tr><td><font face="Verdana, Arial, Helvetica, sans-serif" color="#666666"><h5>Multisoft International is thankful to you for opening your account! <br /> This email is sent to you confirm your email. Please click the activation code given below!</h5></font></td></tr>\r\n';
$message .= "<tr><td><h5><b> <?php echo $link ?> </b></h5></font</td></tr>\r\n";
$message .= '<tr><td><font face="Verdana, Arial, Helvetica, sans-serif" color="#666666"><h5><b>Regards!</b></h5></font></td></tr>\r\n';
$message .= '<tr><td><font face="Verdana, Arial, Helvetica, sans-serif" color="#666666"><h5><b>Bye.</b></h5></font></td></tr>\r\n';
$message .= '</table>\r\n';
$message .= '</body></html>';
/*$message.="Click on this link to activate your account \r\n";*/
// send email
$sentmail = mail($to,$subject,$message,$header);
}
// if not found
else {
echo "Not found your email in our database";
}
// if your email succesfully sent
if($sentmail){
$msg = "Your Confirmation link Has Been Sent To Your Email Address.";
}
else {
$err = "Cannot send Confirmation link to your e-mail address";
}
?>
Please help me in this problem!
Thanks.
Best Regards!
Bye.