mariocesar Posted July 3, 2008 Share Posted July 3, 2008 hello, this is a text that appear in users e-mail, how can I make the image shown on the e-mail, the way is here don't work, thanks $receiptMessage = "Thank you ".$name." Your free sample kit will arrive in 3 to 7 days .\n\n\nHere is what you submitted to us:\n\n" ."Name: ".$name."\n" ."Company: ".$company."\n" ."Address: ".$address_1."\n" ."City State zip: ".$city."\n" ."Phone: ".$bphone."\n" ."Email: ".$email."\n\n" ."Best Regards.\n\n" ."img src='http://www.allstateprint.com/nwsimgs/contact_logo.jpg'\n" ."791 Paulison Ave\n" ."Clifton, NJ 07011\n" ."Tel. 973.473.0700\n"; Quote Link to comment Share on other sites More sharing options...
DarkWater Posted July 3, 2008 Share Posted July 3, 2008 Firstly, you missed the < > around the image tag...Secondly, you need to send a bunch of headers for HTML e-mail. I'd probably recommend PHPMailer unless you want to do it by hand. Quote Link to comment Share on other sites More sharing options...
thatsgreat2345 Posted July 3, 2008 Share Posted July 3, 2008 and you can also use variables inside of double quotes. Quote Link to comment Share on other sites More sharing options...
TransmogriBenno Posted July 3, 2008 Share Posted July 3, 2008 http://pear.php.net/package/Mail_Mime Quote Link to comment Share on other sites More sharing options...
mariocesar Posted July 3, 2008 Author Share Posted July 3, 2008 that was part of the script, this is the complete one is working fine but the image don't show, just the link. <? $name=$_POST['name']; $company=$_POST['company']; $email=$_POST['email']; $bphone=$_POST['bphone']; $address_1=$_POST['address_1']; $address_2=$_POST['address_2']; $city=$_POST['city']; $state=$_POST['state']; $zip=$_POST['zip']; $country=$_POST['country']; $cu_industry=$_POST['cu_industry']; $cu_role=$_POST['cu_role']; $cu_howhear=$_POST['cu_howhear']; $catalogID1=$_POST['catalogID1']; $catalogID2=$_POST['catalogID2']; $catalogID3=$_POST['catalogID3']; $urgency=$_POST['urgency']; $comments=$_POST['comments']; $sv_4=$_POST['sv_4']; //---------VALIDATION--------> if($email){ } else{ $error.=""; } if($error==""){ echo "Thank you! Your Samples, will be mailed to you immediately."; $mailContent="--------Contact--------\n" ."Name: ".$name."\n" ."Company: ".$company."\n" ."Address: ".$address_1."\n" ."City State zip: ".$city."\n" ."Phone: ".$bphone."\n" ."Email: ".$email."\n"; //---------------------------------- $toAddress="mario@allstateprint.com"; $subject="Direct Mail Free Samples"; $recipientSubject="Allstate Direct Mail Free Samples"; $receiptMessage = "Thank you ".$name." Your free sample kit will arrive in 3 to 7 days .\n\n\nHere is what you submitted to us:\n\n" ."Name: ".$name."\n" ."Company: ".$company."\n" ."Address: ".$address_1."\n" ."City State zip: ".$city."\n" ."Phone: ".$bphone."\n" ."Email: ".$email."\n\n" ."Best Regards.\n\n" ."<img src='http://www.allstateprint.com/nwsimgs/contact_logo.jpg'><br/>" ."791 Paulison Ave\n" ."Clifton, NJ 07011\n" ."Tel. 973.473.0700\n"; //---------------------------------- mail($email, $recipientSubject, $receiptMessage,"From:$toAddress"); //---------------------------------- mail($toAddress,$subject,$mailContent,"From:$email"); $connection=mysql_connect('loco', $user = "directmail", $pass = "locoloco") or die("Unable to connect!"); mysql_select_db("directmail") or die("Unable to select database!"); $query="INSERT INTO freesamples ( name, company, email, bphone, address_1, address_2, city, state, zip, country, cu_industry, cu_role, cu_howhear, catalogID1, catalogID2, catalogID3, urgency, comments, sv_4) VALUES( '".$name."', '".$company."', '".$email."', '".$bphone."', '".$address_1."', '".$address_2."', '".$city."', '".$state."', '".$zip."', '".$country."', '".$cu_industry."', '".$cu_role."', '".$cu_howhear."', '".$catalogID1."', '".$catalogID2."', '".$catalogID3."', '".$urgency."', '".$comments."', '".$sv_4."')"; $result=mysql_query($query) or die("Error in query:".mysql_error()); mysql_close($connection); } else{ print "Sorry, but the form cannot be sent until the fields indicated are filled out completely - <br>\n"; print "$error<br>\n"; print "<br>\n"; print "<br>\n"; print "Please use your \"Back\" button to return to the form to correct the omissions. Thank you.<br>\n"; } ?> Quote Link to comment Share on other sites More sharing options...
DarkWater Posted July 3, 2008 Share Posted July 3, 2008 You need special headers to parse HTML and send MIME mail. Check TransmogriBenno's link and check out PHPMailer. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.