Jump to content

Email attachment not openable in some cases


Tarem

Recommended Posts

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!

 

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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. 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.