Page 1 of 1

Correct Mime type to send pdf via email

Posted: Tue Dec 13, 2005 9:02 am
by Skittlewidth
I'm trying to use Todd_Z's email with attachment class (viewtopic.php?t=34242) to email a pdf to myself immediately after its been created using fPDF.

I wind up with an email and attachment but its corrupted or as Acrobat states, "was sent via email and hasn't been correctly decoded".

I'm guessing I'm not using the correct MIME type, and google has come up with several different ones for .pdf files.

This is the line of code to add the attachment:

Code: Select all

$email ->addAttachment ( "pdf_files/".$filename.".pdf", $filename, "application/x-pdf");
No matter what I've tried, the pdf comes through as 273 bytes instead of 28kb.

Is my mime type wrong or do you think I've got my path to the file incorrect? (I'll go and test that in a sec!)