I have built the form and got the processing scrip to work but am having a problem sending both a message and an attachment. The form works fine and returns all the variables in an echo statement when I submit but I can't work out how to send a message body. When I recieve an email from the form I get the sender, subject and attachment but how can I send the sender, subject, message and attachment. http://www.fisicx.com/formmail/attachment2.htm for the Html Form. http://www.fisicx.com/formmail/attachment2.txt for the PHP script (txt extension so you can download it). (Not got live links yet) What I want is to send the frame type and size in the message body and attach an image file. Where do I put the necessary code? Ta very much
I had similar problems in the past. I have not read your code but I found the problem to be with the boundary declaration What I suggest you do is to ensure that within your email headers, your Boundary starts with ----= That is four dashes then equals. Now the Mime within the message each part should start with ------= SIX dashes and an equals. I just grabbed a RAW email that shows this MIME-Version: 1.0 Content-Type: multipart/related; type="multipart/alternative"; boundary="----=_NextPart_000_0014_01C791BF.6BC34990" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2462.4682 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2462.1081 X-Spam-Exim: ThJ2qxCzY5dcl2FzdhlAx6is This is a multi-part message in MIME format. ------=_NextPart_000_0014_01C791BF.6BC34990 Content-Type: multipart/alternative; boundary="----=_NextPart_001_0015_01C791BF.6BC34990" ------=_NextPart_001_0015_01C791BF.6BC34990 Content-Type: text/plain; Code (markup):
Sending attachments can get pretty messy. If you are new to PHP you will have an easier time using a class that handles the messy details. PHPMailer is a good example: http://phpmailer.sourceforge.net/
Thanks for your replies, It was the MIME boundaries. I've changed the script: http://www.fisicx.com/formmail/uploader3.htm http://www.fisicx.com/formmail/uploader3.txt Works much better now, it's just the validation that doesn't do what it is suppsed to do. Ho hum.
Yes, it took me several days to work out and correct the MIME boundaries myself. It is one thing that is not well documented anywhere and took a fair bit of digging to get there. you'll get there!
The joy of PHP. Still fairly new to the game so venturing out from HTML takes me well away from my comfort zone. Much prefer to stay within a mouse click of CSS, much more sensible than all those weird symbols on the top row of my keyboard.