05-20-2010, 09:06 PM
|
#1 (permalink)
|
|
The Acquainted
Join Date: Oct 2008
Location: Cincinnati
Posts: 151
Thanks: 14
|
Attaching image file to email form
I am trying to allow users of my website to be able to send and attach files when they use my contact form. I have never actually messed around with this type of thing. But this is going to be kind of essential and help increase my business (hopefully) here is what I have right now this works I just want to add the attach file to it but not sure where to start. Help please?
PHP Code:
<?php
$sendTo = "Email Here";
$subject = $_GET['csubject'];
$message = $_GET['cmessage'];
$email = $_GET['cemail'];
$name = $_GET['cname'];
$phone=$_GET['cphone'];
//send mail info
$headers = "From: $email\r\n";
//$headers .= 'MIME-Version: 1.0' . "\r\n";
//$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$msg = "\n\n Name:".$name."\n\n Phone:".$phone."\n\n E-Mail:".$email."\n\n Message:".$message."";
//send mail
mail($sendTo, $subject, $msg, $headers);
?>
|
|
|
|