Hi there,
I currently have a feedback form allowing users to email me from a web based form using PHP. However, i would like to allow people to attach files to the email, so when i recieve the email, it contains both the text information submitted on the form, and the file attachment attached.
I was wondering if anyone could advise me to do this? I include my current php code. Hope it helps.
Any advice on a solution would be great.
Jonathan
==== Mail.php ====
<?php
// Check to see if user has completed ALL boxes
if($company_name && $address && $city && $state && $zip_code && $phone_number && $email_address && $update) {
// Check that the email is valid by checking for '@' symbol
if (strrpos($email_address,'@') > 0) {
// Send The eMail to us
mail(",myemail@mydomain.com", "Website Contact", "
Company Name: $company_name
Address: $address
City: $city
State: $state
Zip Code: $zip_code
Phone Number: $phone_number
Email Address: $email_address
Remote Address (Incase of Abuse): $REMOTE_ADDR
$update
To reply to this email, simply click reply using your email agent.", "From: $email_address");
// Print
print "Thankyou for your update! Your email has been sent, and we will be in contact with you in the near future!<br><br><br><br>";
} else {
print "Email Invalid.";
}
} else {
print "Please complete all boxes.";
}
?>
==== End Mail.php ====
Thanks 🙂