stockdalep Posted April 22, 2007 Share Posted April 22, 2007 Hi I have a HTML email and inside this I need to use a PHP variable that contains a string with html line breaks inside it. Can this be done. Thanks for any help. $message =' <html> <body bgcolor="#FFFFCC" text="#000000"> <div align="center"> <h1>Thank you for registering</h1> <br> <table width="385" border="0" cellspacing="2" cellpadding="2" height="74"> <tr bgcolor="#CC9900"> <td>"$items"</td> </tr> </table> </div> </body> </html> '; Quote Link to comment Share on other sites More sharing options...
paul2463 Posted April 22, 2007 Share Posted April 22, 2007 try this one, it works on my pages, <?php $message =" <html> <body bgcolor='#FFFFCC' text='#000000'> <div align='center'> <h1>Thank you for registering</h1> <table width='385' border='0' cellspacing='2' cellpadding='2' height='74'> <tr bgcolor='#CC9900'> <td> $items </td> </tr> </table> </div> </body> </html> "; ?> Quote Link to comment Share on other sites More sharing options...
stockdalep Posted April 22, 2007 Author Share Posted April 22, 2007 Thanks for your time, God knows why it did not work for me first time around Quote Link to comment Share on other sites More sharing options...
paul2463 Posted April 22, 2007 Share Posted April 22, 2007 I replaced you double quotes with single ones and vice versa, you have to get to know which way round the go if you wish to include HTML and variables Quote Link to comment Share on other sites More sharing options...
V34 Posted April 22, 2007 Share Posted April 22, 2007 If you want your way with the single quote working, do this $message =' <html> <body bgcolor="#FFFFCC" text="#000000"> <div align="center"> <h1>Thank you for registering</h1> <table width="385" border="0" cellspacing="2" cellpadding="2" height="74"> <tr bgcolor="#CC9900"> <td>'.$items.'</td> </tr> </table> </div> </body> </html> '; 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.