Help - PHP Form Script, Attachment to Email
Posted: Mon Jun 08, 2009 3:20 pm
Hi, I'm a graphic designer (not a web programmer), and I'm trying to process an html form and have the information sent to my e-mail. I can only write html, so I've just been taking php scripts off of the internet and trying to make them process my form. Below is the only script that I've gotten to transmit the email, but it's only sending the text. I need it to also send file attachments. Can you even send file attachments to an email? Or would it have to be sent to some sort of directory that's stored on my server (I'd like to avoid doing that if possible since this is already over my head).
Can someone please give me an idea of what I would need to do here. Like I said, I'm not a programmer, so please keep it very simple.
Thank you!
<?PHP
$date = date ("l, F jS, Y");
$time = date ("h:i A");
$msg = "Below is the result of your feedback form. It was submitted on $date at $time.\n\n";
if ($_SERVER['REQUEST_METHOD'] == "POST") {
foreach ($_POST as $key => $value) {
$msg .= ucfirst ($key) ." : ". $value . "\n";
}
}
else {
foreach ($_GET as $key => $value) {
$msg .= ucfirst ($key) ." : ". $value . "\n";
}
}
mail($to, $subject, $msg, $headers);
if ($forward == 1) {
header ("Location:$location");
}
else {
echo "Thank you for submitting our form. We will get back to you as soon as possible.";
}
?>
Can someone please give me an idea of what I would need to do here. Like I said, I'm not a programmer, so please keep it very simple.
Thank you!
<?PHP
$date = date ("l, F jS, Y");
$time = date ("h:i A");
$msg = "Below is the result of your feedback form. It was submitted on $date at $time.\n\n";
if ($_SERVER['REQUEST_METHOD'] == "POST") {
foreach ($_POST as $key => $value) {
$msg .= ucfirst ($key) ." : ". $value . "\n";
}
}
else {
foreach ($_GET as $key => $value) {
$msg .= ucfirst ($key) ." : ". $value . "\n";
}
}
mail($to, $subject, $msg, $headers);
if ($forward == 1) {
header ("Location:$location");
}
else {
echo "Thank you for submitting our form. We will get back to you as soon as possible.";
}
?>