Jump to content

PHP Mail


01hanstu

Recommended Posts

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

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.