Email Dynamic Image Insert
Posted: Sun Dec 13, 2009 10:23 am
HI. The following code from the beginning of an html email works in a dynamically generated email to insert a fixed image. When I replace the end of the image URL string to try and make it a dynamic image based on the recipent, I cannot get it to work. My replacement string is at the end of the working (fixed image) code. Can anyone tell me what I am missing (probably a lot:) Many thanks in advance for any help.
My attempt at dynamic image by replacing the $headerPic line photo.jpg at the end with dynamic bla bla is:
where the dbase field Image_URL holds .jpg photo names which are stored in the folder photos.
Any help would be greatly appreciated!
Code: Select all
<?php
$id = $row_rsucites['Item_Num'];
$to = $row_rsucites['Email1'] . " , ";
$to .= $row_rsucites['Email2'] . " , ";
$to .= $row_rsucites['Email3'];
$subject = "Sample Subject";
$headerPic = '<IMG src="http://sample.com/Sections/uctionItems/photos/photo.jpg">';
$body = "<html><body>" .
"<h2><center>With Compliments: From Sample.com!<br><br>
Sample Text!</center></h2>" .
"<p><center>$headerPic</center></p>" .
Code: Select all
$headerPic = '<IMG src="http://sample.com/Sections/uctionItems/photos/$row_rsucites['Image_URL'];">';
Any help would be greatly appreciated!