i am trying to get an image file to display in an email, the file is stored on the server but it will not send the file with the email. i have been working on this code now for a few days and i cannot get it to work.
the files that i need displaying change so i have incorporated an array to get the file extension, the email is sent with all the text and images which have been coded in using the absolute file path but the images i want to get from the if file exists function will no show.
here is the code for the file exist if anyone can see why this is not working please show me.
$image = "";
$web_image_folder = 'http://www.acmeart.co.uk/mercury/image/thumbs';
$exts = array('jpg', 'png', 'gif', 'jpeg');
$image_name = 'thumb_image1';
// check for each extension
foreach($exts as $ext) {
if (file_exists($web_image_folder.'/'.$image_name.'.'.$ext)) {
$image = $image_name.'.'.$ext;
}
}
// check if we have an image
if ($image != "") {
// ok we have the image
$broad_img1='<img src="' . $web_image_folder."/".$image . '" />';
} else {
// error, we can't find the image.
}