Hi,
I have a form that get sent to email via PHP and works fine.
I wan to add ability to add attachments and have them sent through too.
I have tried to do this but could not get it working.
So, here is my basic PHP for the form info to be sent through, can anyone modify it to send attachments too?
<?php
$not_to = "phil@kralinator.com";
$not_from = "felinevet.net";
$not_subj = "Online Consultancy Enquiry";
if (isset($_POST['print']) && $_POST['print']!= 'none'){
if (is_array($_POST['print'])){
$pr = implode("\n", $_POST['print']); // format your array for use
} else {
$pr = $_POST['print']; // no array -> print single value
}
}
$nm = trim(strtolower($_POST["Name"]));
$em = trim($_POST["email"]);
$ad = trim($_POST["Address"]);
$vc = trim($_POST["Voucher-Code"]);
$ip = $_SERVER["REMOTE_ADDR"];
$msg = "Enquiry submitted on " . date("l jS F Y H:i:s") . "\n\n";
$msg .= "Name \n" . $nm . "\n\n";
$msg .= "email \n" . $em . "\n\n";
$msg .= "Address \n" . $ad . "\n\n";
$msg .= "Childs Name \n" . $cn . "\n\n";
$msg .= "VOUCHER CODE \n" . $vc . "\n\n";
$msg .= "IP Address\n" . $ip . "\n\n";
$headers = "From: Feline Vet Website <" . $not_from . ">";
mail($not_to, $not_subj, $msg, $headers);
header("location: thankyou.html");
?>


