TRemmie Posted September 19, 2008 Share Posted September 19, 2008 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 ??? Link to comment https://forums.phpfreaks.com/topic/124881-catching-variables-inside-a-php-emailer-that-uses-a-html-body/ Share on other sites More sharing options...
F1Fan Posted September 19, 2008 Share Posted September 19, 2008 Add {} around any array within double quotes, like this: $html .= "<html><body>{$_POST["Message"]}</body></html>"; And drop the semicolon. Link to comment https://forums.phpfreaks.com/topic/124881-catching-variables-inside-a-php-emailer-that-uses-a-html-body/#findComment-645265 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.