Trying to have a PHP script send an email that contains two images that the user is pre-selecting from a previous page (out of a select element). I’m not quite sure how to accomplish the image attachment. Here is my code, not working obviously, please let me know if my logic is right or if I’m way off here.
<?php
$to=$_POST["email"];
$bannerimg=$_POST["banimg"];
$adimage=$_POST["adimage"];
$bannerimageshow=echo "<img src=imgdir/$bannerimg>"."<br /><br />";
$adimageshow=echo "<img src=addir/$adimage>"."<br /><br />";
echo $bannerimageshow;
echo $adimageshow;
/*
$subject=$_POST["subject"];
$message=$_POST["message"];
$from="mailface@mailface.com";
$headers=array();
$headers[]="MIME-Version: 1.0";
$headers[]="Content-type: text/html; charset=iso-8859-1";
$headers[]="Content-Transfer-Encoding: 8bit";
$headers[]="From: ".$from;
$advertised=mail($to,$bannerimageshow,$adimageshow,$subject,$message,join("\n",$headers));
if ($advertised){
echo "Working";
}
*/
?>
My echo statements are not returning anything. Any and all help is appreciated 🙂
Thanks in advance.
Dustin
echohas no return value.Instead of
just use
or, even simpler,