如何将使用file_get_contents()获取的图像附加到电子邮件中?

I'm using file_get_contents() to get my webpage and email it to users

I'm using it in this way:

$html=file_get_contents($path);

and it brings the webpage along with the images but when I use it to send an email it doesn't send images with it.

My code is shown below. I have defined $path in the beginning and it works perefectly.

$html =file_get_contents($path);
$file = $path; 
$crlf = "
"; 
$hdrs = array( 
          "From"    => "members@********.com", 
          "Subject" => "Nice to meet you" 
          ); 

$mime = new Mail_mime($crlf); 

$mime->setTXTBody($text); 
$mime->addHTMLImage ($file, "images/jpeg"); 
$mime->setHTMLBody($html); 

$body = $mime->get(); 
$hdrs = $mime->headers($hdrs); 


$mail =& Mail::factory("mail"); 
$mail->send($contact_email, $hdrs, $body); 

I receive an email with the text and css but the images are not getting loaded

I assume your img link has relative path like

img src='image/image.png' if so then change it to

img src='http://yoursite/image_location/image.png'

or may be your email client is blocking image