Jump to content

Catching Variables inside a PHP Emailer that uses a HTML Body?


TRemmie

Recommended Posts

Hi, I have always used straight up Flash / PHP email forms but I recently started working on something that will create a 'advanced' email, and will have pictures and such inside the Email that is sent from the PHP, so I picked up MIME/PEAR and ended up with a code like:

 

<?php 
include("Mail.php"); 
include("Mail/mime.php"); 

$html = '<html><body><img src="image.jpg"><br><br></body></html>'; 
$html .= '<html><body> $_POST["Message"];</body></html>';
$file = "image.jpg"; 
$crlf = "\r\n"; 
$hdrs = array( 
              "From"    => "[email protected]", 
              "Subject" => "Test mime message" 
              ); 

$mime = new Mail_mime($crlf); 

$mime->setTXTBody($text); 
$mime->addHTMLImage ($file, "image/jpeg"); 
$mime->setHTMLBody($html); 
$body = "TestABC";
$body = $mime->get(); 
$hdrs = $mime->headers($hdrs); 


$mail =& Mail::factory("mail"); 
$mail->send("[email protected]", $hdrs, $body, $message); 
?>

 

I have no idea how I get the variable $_POST["Message"] to actually appear in the Email, under image.jpg, if someone could PLEASE help  ???

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.