PHP Learner Posted January 16, 2012 Share Posted January 16, 2012 Hello one and all, Just a quick request here, I've written a script that sends an email with an attached file by the user. (docx, txt, pdf, doc, rtf) are the formats I have accepted. At the moment I'm sending them with the following... $fileatt_type = "application/pdf"; // File Type It works fine with all formats in older email clients, i.e, like yahoo before they updated the layout, but in the newer versions it's specific and if I try to send it this way it is always delivered as a .PDF and doesn't open if it is any of the other formats. It may sound silly but I've searched a fair bit for the other extensions or formats to include instead of the above code (maybe something like application/doc or something) but there doesn't seem to be a list. Can anyone point me in the right direction? Much obliged, PHP the learned. Quote Link to comment https://forums.phpfreaks.com/topic/255137-anyone-know-the-php-header-file-extensions-for-sending-attached-documents/ Share on other sites More sharing options...
laffin Posted January 16, 2012 Share Posted January 16, 2012 found a list here, but there a tons of other mime types. maybe you should consider using application/octet-stream, a binary type. Quote Link to comment https://forums.phpfreaks.com/topic/255137-anyone-know-the-php-header-file-extensions-for-sending-attached-documents/#findComment-1308143 Share on other sites More sharing options...
PHP Learner Posted January 16, 2012 Author Share Posted January 16, 2012 Thanks laff, couldnt find your link but I went with this which seems to cover most of them. $fileatt_type = "application/doc, application/txt, application/pdf, application/rtf, appl/text, application/vnd.msword, application/vnd.ms-word, application/winword, application/word,"; // File Type Not sure about rich text documents tho, It's seems like they dropped it from Win 7. Cheers mate, LP Quote Link to comment https://forums.phpfreaks.com/topic/255137-anyone-know-the-php-header-file-extensions-for-sending-attached-documents/#findComment-1308146 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.