
December 7th, 2012, 08:40 AM
|
|
Registered User
|
|
Join Date: Nov 2012
Location: Edinburgh
Posts: 19
Time spent in forums: 3 h 19 m
Reputation Power: 0
|
|
Quote: | Originally Posted by Northie Exactly the same as if you were building it for a webpage but instead of echo, use variable concatenation,
eg
PHP Code:
//
echo "<table>";
echo "<tr><td>....</td><td>....</td></tr>";
echo "<tr><td>....</td><td>....</td></tr>";
echo "<tr><td>....</td><td>....</td></tr>";
echo "<tr><td>....</td><td>....</td></tr>";
echo "</table>";
becomes
PHP Code:
//
$output.="<table>";
$output.="<tr><td>....</td><td>....</td></tr>";
$output.="<tr><td>....</td><td>....</td></tr>";
$output.="<tr><td>....</td><td>....</td></tr>";
$output.="<tr><td>....</td><td>....</td></tr>";
$output.="</table>";
if you're going from existing source code to new, do a find and replace for "echo" and replace with "$output.=" (without quotes  )
Then, use a library like PHPMailer (see gw1500se's post) to build and send an HTML email (using the html that's in your $output variable);
If you really really really wanted to use echo then you'd want to wrap output buffers around the relevant echo statements and then collect the contents into a variable which you would then pass into PHPMailer to send an html email |
Hi there
Thank you for pointing me in the right direction, i'm going to give it a go and see how i get on.
Thank you
Hudbarnett
|