niadev Posted February 28, 2008 Share Posted February 28, 2008 I've just created a Contact Us form where users can email me from a website I created: www.greencastleparish.com/contactusbackup.htm. As you can see I have provided users with the option to attach a file to send to me. The problem is that when I test it I can receive the email ok, but there are no attachments. Here's the PHP script: <?php $formurl = "http://www.greencastleparish.com/contactusbackup.htm" ; $thankyouurl = "http://www.greencastleparish.com/thankyou.htm" ; $uself = 0; $headersep = (!isset( $uself ) || ($uself == 0)) ? "\r\n" : "\n" ; $name = $_POST['Name'] ; $telephone = $_POST['Telephone'] ; $email = $_POST['Email'] ; $comments = $_POST['Questions/comments'] ; $http_referrer = getenv( "HTTP_REFERER" ); $subject = "New comment from $name"; $message = "This message was sent from:\n" . "$http_referrer\n" . "------------------------------------------------------------\n\n" . "Name: $name\n" . "Email: $email\n" . "Telephone: $telephone\n" . "------------------------- COMMENTS -----------------------\n\n" . $comments . "\n\n------------------------------------------------------------\n" ; mail("[email protected]", $subject, $message, "FROM: [email protected]" . $headersep . "Reply-To: \"$name\" <$email>" . $headersep . "X-Mailer: chfeedback.php 2.07" ); header( "Location: $thankyouurl" ); exit ; ?> Niall Link to comment https://forums.phpfreaks.com/topic/93542-allowing-attachments-in-an-email/ Share on other sites More sharing options...
niadev Posted March 6, 2008 Author Share Posted March 6, 2008 Anyone? Link to comment https://forums.phpfreaks.com/topic/93542-allowing-attachments-in-an-email/#findComment-485030 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.