01hanstu Posted November 13, 2008 Share Posted November 13, 2008 Hi, hope you can help. I am currently working on a booking system and have now almost completed it, however i wan t to know if there is any way to have the email that gets send to the booking manager to have images in i.e. the company logo ... The code at the minute for the body of the email is: $body = "Hi \n Just a Quick Email to let you know that an ICT Room has been Booked \n $logon_name has booked $room for lesson $lessonno on $easydate \n \n *****THIS EMAIL IS FORM INFORMATION PURPOSES ONLY*****"; But the idea now is to make the email a html instead of plain text, Please Advise Stuart Hannah Quote Link to comment Share on other sites More sharing options...
kev wood Posted November 13, 2008 Share Posted November 13, 2008 if you are storing the images in folder on the server then this will work for inserting the images into the email. $rand = rand (0 , 100); $image = ""; $broad_img1= ""; $path= 'http://yoursite.com/'; // sets the first half of the path $web_image_folder = 'image/thumbs/broad/broad1'; // defines the folders to look in $exts = array('jpg', 'png', 'gif', 'jpeg'); // sets up the array $image_name = 'thumb_broad1'; $size1 = 'width="200" height="200"'; // 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="' . $path."/".$web_image_folder."/".$image."?".$rand . $size1 .'" />'; } else { // error, we can't find the image. "cannot find!!"; } then where you want the image to display you would put this ' . $broad_img1 .' hope this helps. Quote Link to comment Share on other sites More sharing options...
dflow Posted November 13, 2008 Share Posted November 13, 2008 hi use MIME AND READ THIS TUTORIAL: http://www.codewalkers.com/c/a/Email-Code/PHP-Text-HTML-Email-with-Attachments-21/ Quote Link to comment Share on other sites More sharing options...
kev wood Posted November 13, 2008 Share Posted November 13, 2008 sorry if i am mistaken but is the mime function only for sending attachments with the mail and not putting images within the mail? i no it not my thread but i would know if it is possible to use that function in that way. 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.