sblake161189 Posted February 2, 2011 Share Posted February 2, 2011 Hi Guys, I have a php mail script that calculates a branch to send it to dependant on the postcode which works fine as it goes to the right email and when I echo the script to show branch name it comes up with the correct branch name. However when you open the email I cannot get it to display the 'branch name'. It will display all the other bits of information that has been 'posted' from the form. But wont display the branch name form an sql database table. The code below proves that it finds the branch name. while($row = mysql_fetch_array( $result )) { $ter = $row['Ter']; $branchemail = $row['BranchEmail']; $branchname = $row['BranchName']; } This is the PHP Mail in HTML part below <td bgcolor=#FFFFFF bordercolor=#666666 valign=top>' . ( $row['BranchName']) . '</td> But when the email comes through the branch name is always blank. However on this page I can get it to echo the branch name and it displays the branch name and also emails to the branch email address. Any ideas why it doesn't work. Cheers, S Quote Link to comment Share on other sites More sharing options...
sblake161189 Posted February 2, 2011 Author Share Posted February 2, 2011 Sorry forgot to say the other fields work, ie what it has got from the form <td bgcolor=#FFFFFF bordercolor=#666666 valign=top>' . strip_tags($_POST['comments']) . '</td> They show in the email... Quote Link to comment Share on other sites More sharing options...
BlueSkyIS Posted February 2, 2011 Share Posted February 2, 2011 see how the line of html you posted is oddly colored? that often indicates broken or missing elements. values in HTML tags should always be quoted or double-quoted. echo '<td bgcolor="#FFFFFF" bordercolor="#666666" valign="top">' . strip_tags($_POST['comments']) . '</td>'; Quote Link to comment 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.