Forum Moderators: coopster

Message Too Old, No Replies

form script, html emails?

want to add img to email

         

briesm

9:16 pm on Jun 13, 2005 (gmt 0)

10+ Year Member



So I have this form script working, but whenever I mess around with headers it doesn't send the email any more. I'm looking to simply add one image into the top of the email. When I try to even add headers to get a From address and a reply to the email just doesn't send at all. So I haven't even messed with adding an image from my server, but I assume it just involves adding an img src tag to the beggining of my $message variable? Here's my code I'm using to try to send an html email via Post:

<?php

$headers = "From: myplace@here.com\r\n";
$headers .= "Reply-To: myplace2@here.com\r\n";
$headers .= "Return-Path: myplace@here.com\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";

if(isset($_POST['sendEmail'])){

$my_email = "blah@blah.com";

if ($_SERVER['REQUEST_METHOD']!= "POST"){exit;}

$message = "";

while(list($key,$value) = each($_POST)) {
if (!(empty($value))) {
$set=1;
$message = $message . "$key: $value\n\n";
}
}
$message = stripslashes($message);

$subject = "Cool Stuff";

mail($my_email,$subject,$message,$headers);

session_destroy();

header("Location: [yahoo.com");...]

exit;
}

?>

mcibor

10:15 pm on Jun 13, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I found this while looking for your answer:

[phpguru.org...]

Or just see [php.net...]

Best regards
Michal Cibor