[email protected] Posted November 22, 2009 Share Posted November 22, 2009 I am trying to send email in for of a template <?php $to_email = "[email protected]"; $subject = "Greetings"; $message =?> <table width="676"> //Getting unexpecting ';' here <tr> Hi <td width="30" height="52"><img src="Side.gif" width="30" height="50" alt="Corner" /></td> <td width="600"><img src="Top.gif" width="600" height="50" alt="Top" /></td> <td width="30"><img src="Side.gif" width="30" height="50" alt="Corner" /></td> </tr> </table> I am getting a unexpected';' How can I properly arrange the table here? Quote Link to comment https://forums.phpfreaks.com/topic/182480-html-tag-in-php/ Share on other sites More sharing options...
doddsey_65 Posted November 22, 2009 Share Posted November 22, 2009 <?php $to_email = "[email protected]"; $subject = "Greetings"; $message = echo '<table width="676"><tr>Hi <td width="30" height="52"><img src="Side.gif" width="30" height="50" alt="Corner" /></td> <td width="600"><img src="Top.gif" width="600" height="50" alt="Top" /></td> <td width="30"><img src="Side.gif" width="30" height="50" alt="Corner" /> </td></tr></table>'; ?> Quote Link to comment https://forums.phpfreaks.com/topic/182480-html-tag-in-php/#findComment-963076 Share on other sites More sharing options...
[email protected] Posted November 22, 2009 Author Share Posted November 22, 2009 Are you sure echo is going to work, because I would be using mail() function at the end right??? <?php $to_email = "[email protected]"; $subject = "Greetings"; $message =?> <table width="676"> //Getting unexpecting ';' here <tr> Hi <td width="30" height="52"><img src="Side.gif" width="30" height="50" alt="Corner" /></td> <td width="600"><img src="Top.gif" width="600" height="50" alt="Top" /></td> <td width="30"><img src="Side.gif" width="30" height="50" alt="Corner" /></td> </tr> </table> <?php mail($to_email, $subject, $message); ?> Quote Link to comment https://forums.phpfreaks.com/topic/182480-html-tag-in-php/#findComment-963080 Share on other sites More sharing options...
Garethp Posted November 22, 2009 Share Posted November 22, 2009 <?php $to_email = "[email protected]"; $subject = "Greetings"; $message = '<table width="676"><tr>Hi <td width="30" height="52"><img src="Side.gif" width="30" height="50" alt="Corner" /></td> <td width="600"><img src="Top.gif" width="600" height="50" alt="Top" /></td> <td width="30"><img src="Side.gif" width="30" height="50" alt="Corner" /> </td></tr></table>'; mail($to_email, $subject, $message); Quote Link to comment https://forums.phpfreaks.com/topic/182480-html-tag-in-php/#findComment-963081 Share on other sites More sharing options...
[email protected] Posted November 22, 2009 Author Share Posted November 22, 2009 <?php ... $message = '<table width="676"><tr>Hi <td width="30" height="52"> .....'; mail($to_email, $subject, $message); This doesn't work my frd...it sends the message as <table>.........Hi <td width......> We want to use the HTML table and its images which it calls and send only HI Quote Link to comment https://forums.phpfreaks.com/topic/182480-html-tag-in-php/#findComment-963083 Share on other sites More sharing options...
FaT3oYCG Posted November 22, 2009 Share Posted November 22, 2009 <?php $to_email = "[email protected]"; $subject = "Greetings"; $message = '' . '<table width="676">' . '<tr>' . 'Hi' . '<td width="30" height="52"><img src="Side.gif" width="30" height="50" alt="Corner" /></td>' . '<td width="600"><img src="Top.gif" width="600" height="50" alt="Top" /></td>' . '<td width="30"><img src="Side.gif" width="30" height="50" alt="Corner" /></td>' . '</tr>' . '</table>'; ?> might be easier to read and the reason it doesnt display correctly is probably because your table isnt set up right and you have to tell the mail function that you want to send mail in html mode. e.g. $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; mail($to_email, $subject, $message, $headers); Quote Link to comment https://forums.phpfreaks.com/topic/182480-html-tag-in-php/#findComment-963084 Share on other sites More sharing options...
[email protected] Posted November 22, 2009 Author Share Posted November 22, 2009 The email is received in the template form...but those gif images are missing ?? Where those gif images are supposed to come, it is showing missing image sign. Any help Quote Link to comment https://forums.phpfreaks.com/topic/182480-html-tag-in-php/#findComment-963089 Share on other sites More sharing options...
eugene2009 Posted November 22, 2009 Share Posted November 22, 2009 thats probably because you are not having the images sent also.. try putting those pictures on a server and just including the whole url e.g. <img src="http://www.your_domain.com/side.gif"> Quote Link to comment https://forums.phpfreaks.com/topic/182480-html-tag-in-php/#findComment-963091 Share on other sites More sharing options...
[email protected] Posted November 22, 2009 Author Share Posted November 22, 2009 Its fixed... thanks I just had to reference those gif files from "picture.gif" to "http://mysite.com/picture.gif" And it worked.. Quote Link to comment https://forums.phpfreaks.com/topic/182480-html-tag-in-php/#findComment-963093 Share on other sites More sharing options...
eugene2009 Posted November 22, 2009 Share Posted November 22, 2009 greatt.. just like i said Quote Link to comment https://forums.phpfreaks.com/topic/182480-html-tag-in-php/#findComment-963095 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.