php email attachement, works but the attachment is corrupt

i have created a form that can send and email with a specified attachment, it come through to my mail address ok, and seem to work fine untill i attempt to open the file, it tell me its damaged or corrupt, i think this is down to my headers.

here is my code.

http://pastebin.com/Y0MUHzSs

any help would be appreciated.

-------------Problems Reply------------

Using the PHP mail function with attachments is pure pain. Just use Swiftmailer for that purpose. This library does everything you need to send the correct encoding and mimetype of the attachment.

Category:php Views:0 Time:2010-09-17

Related post

Copyright (C) dskims.com, All Rights Reserved.

processed in 0.162 (s). 11 q(s)