Tarem Posted June 27, 2010 Share Posted June 27, 2010 Hi, all- I have a php script that emails small epub or pdf files. It's been working successfully, except occasionally, when someone ends up with a file that they can't open. I think that these users are reading their email in Safari on a mac, and possibly the browser cannot tell what type of file it is. When they e-mail me back the file, I can open it without problem, so the file itself is not corrupted. I specified the attachment as (MIME type) application/octet-stream for the epubs and application/pdf for the pdfs. Has anyone else had a similar problem? Let me know, and thanks much for reading! Quote Link to comment Share on other sites More sharing options...
joel24 Posted June 28, 2010 Share Posted June 28, 2010 try the php mailer class, i used to have problems somewhat similar to yours, then I began using this PHP mailer class and I haven't had any troubles since. http://phpmailer.worxware.com/ Quote Link to comment Share on other sites More sharing options...
Tarem Posted June 28, 2010 Author Share Posted June 28, 2010 try the php mailer class, i used to have problems somewhat similar to yours, then I began using this PHP mailer class and I haven't had any troubles since. http://phpmailer.worxware.com/ I think I'll give that a try, thanks much. Quote Link to comment Share on other sites More sharing options...
helptar Posted June 28, 2010 Share Posted June 28, 2010 I personally don't like that class. I wrote my own, but it was HARD to find GOOD information on how to REALLY do this because of that damn class.. Here is a copy and paste of it.. for those who like to pick through code and learn something.. Last I checked.. it worked. Sorry it is doesn't for you!! Sorry saw there was some things in the code that wouldn't work outside of my system. Quote Link to comment Share on other sites More sharing options...
Tarem Posted June 28, 2010 Author Share Posted June 28, 2010 I just downloaded the phpMailer class, got it installed and working. I admit that the documentation attached to it is a bit spotty, but if you look around on the web, there are several good tutorials, and the test scripts included are useful. Thanks much for pointing me towards this solution. I can't tell what the original problem was, but it seems that one of the biggest drawbacks to writing your own mail() stuff in php is the huge variety of email clients and browsers used. I figure that using a class instead should eliminate at least some of this variability. Quote Link to comment Share on other sites More sharing options...
Tarem Posted June 29, 2010 Author Share Posted June 29, 2010 In case anyone else had the same problem, or is just installing phpMailer and has some noob questions, I wrote up a tutorial of some things that helped me out while installing this mail class. A lot of what's there is already detailed in excellent guides, but there were some things I learned along the way (by screwing them up!) that might prove helpful to someone else. http://annofone.wordpress.com/2010/06/29/phpmailer-setup-for-the-uninitiated/ Cheers! Tarem Quote Link to comment Share on other sites More sharing options...
joel24 Posted June 30, 2010 Share Posted June 30, 2010 In case anyone else had the same problem, or is just installing phpMailer and has some noob questions, I wrote up a tutorial of some things that helped me out while installing this mail class. A lot of what's there is already detailed in excellent guides, but there were some things I learned along the way (by screwing them up!) that might prove helpful to someone else. http://annofone.wordpress.com/2010/06/29/phpmailer-setup-for-the-uninitiated/ Cheers! Tarem nice to see people giving back to the community! good on ya! Quote Link to comment 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.