registration email link address is empty
Posted: Sat Sep 26, 2015 12:25 pm
Hi, I am having problems with the email I am sending out which new members of my website use to activate their account. During my gmail tests (both local host and live) it seems to work fine. However I have become aware that for some people are getting the email such that the text link they click on only contains text without any link address. I am pretty sure the PHP code that creates the link is working. It is shown below stripped of stuff that need not be shown. I have seen many forums where they say "if the link does not work then click the button". So I decided to include a button as well. After struggling with several parsing tries to get the button to work I finally got it to show in the email. However when I try to put the actual activation code into the button code and the URL as well by using variables, PHP is replacing the code inside the variables $URL and $fldMM_Activation with strange replacement characters. I remember reading that there is a command to stop PHP from doing this. Unfortunately I don't remember what it is. Does anyone have any suggestions regarding this problem. Thanks, John
Code: Select all
$file = "ThisMachineIsLocalHostTest.txt";
if(file_exists($file)) {
$URL="http://LOCALHOST/MJN";
} else {
$URL="MyWebiste.com";
}
$RegisterButton = '
<table cellspacing="0" cellpadding="0"> <tr>
<td align="center" width="300" height="40" bgcolor="#000091" style="-webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; color: #ffffff; display: block;">
<a href="' & $URL & '/frmMemberMaster_Activation.php/?code=' & $fldMM_Activation & '" style="font-size:16px; font-weight: bold; font-family: Helvetica, Arial, sans-serif; text-decoration: none; line-height:40px; width:100%; display:inline-block"><span style="color: #FFFFFF">Click the button to activate</span></a>
</td>
</tr> </table>
';
$message = "
<html>
<head>
<title>YCSJ activation</title>
</head>
<body>
<p>Hello $fldMM_FirstName. Thank you for registering.<br></p>
<p><br></p>
<p>Click the link to activate:<br></p>
<p><a href='$URL/frmMemberMaster_Activation.php/?code=$fldMM_Activation'>Click here to activate your account</a></p>
<p> <br></p>
$RegisterButton
</body>
</html>
";