Topic: pdf sent as text in email

Hi

I'm trying to send a statement to a customer (myself as I m testing). I don't get an attached document but instead a criptic ascii bit, which I think is the PDF.

something like
--f557c2c70897ee6a29e37c8b9cd2bffd
Content-Type: application/pdf; name="Statement2.pdf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="Statement2.pdf"

JVBERi0xLjMKMS4wMCB3CjMgMCBvYmoKPDwvVHlwZSAvUGFnZQovUGFyZW50IDEgMCBSCi9N
ZWRpYUJveCBbMCAwIDU5NS4yOCA4NDE

I'm sure I can transform that into a PDF, but I guess my customers won't. Am I only one having this problem ?

/Elax

Re: pdf sent as text in email

This is strange. Have you set any of the debugging flags in config.php? F.i. the $pdf_debug to 1 ?

/Joe

Re: pdf sent as text in email

I have only $debug set to 1.
$pdf_debug is set to 0

(I have always had this problem anyway, even when I first install FA)

/Elax

Re: pdf sent as text in email

Maybe you can trap some errors by setting the $go_debug to 1 (in comfig.php). Also try the $pdf_debug by setting to 1. It would be nice if we could trap the cause of this error.

/Joe

Re: pdf sent as text in email

I get something like that

%PDF-1.3
1.00 w
3 0 obj
<</Type /Page
/Parent 1 0 R
/MediaBox [0 0 595.28 841.89]
/Resources 2 0 R
/Contents 4 0 R>>
endobj
4 0 obj
<</Filter /FlateDecode /Length 1486>>
stream
xœÕš]oÛ6†ïý+°›
kd~‹ÊÕœ¥i×$MÔEÑ ÁV]¯¶ÔÊJ»î׏²¤ˆ”8"ÕˆeÓ9"òå9¤M=BàxažÿÀ»÷æefžgæ9…0þ“e…UøNÃýш§‰ûz}6›ZFRÉâÒºxY±ŠËÜTÍ™J$a`_M%ô‡+Ñ>5·DW&!›WÖ2ØK¶©ê€nîÍbøÐj¤²[¹·Ù´ì}áØ—Åì¥rìËâc;ÁÈã:QÚÜÛ€"n§ÉžNSæt¢*ÚöŽ÷vvV¸î®Ë–    “n%uÙ2áÒ¥.[&BµPÔV-í¡w‡ê±&Ž¯w¹Fµ(˶I{ü\oL¾€6߈‘@Ù†ØL?ئ+ŸS8Iáu©Uæhµþ(Ø«÷z„Só‹yë é\³9˜–Óž6d~á ÞýzNÂÓW§áoï!|aš‡×…%-hþ»¤`õÑ#S…}K_úÚãº$~åyœá8Íóh7ÜÝS(uGAY0WÑ"ë4šõ    !ÅÄEüísšå}¶.Ø]ë§Ñ:‡·iöiýq‘õ:œ4³á
•À^ß@ŸíÓf6¾yù„
—Êâ}*KÍtºú˜&ñ}

Howeve, the PDF seemst alriqht, that's more the 'embedding' of it inside the email which doesn't work

/Elax

Re: pdf sent as text in email

Found it. I have this problem only with Gmail. It doesn't like the quotes around the boundary definition.
I don't know if it's a bug or depend on the encoding. Internet is not consistent about to use or not quotes in boundary delimiter definition. However what works is to change the following lines in 'reporting/includes/class.mail.inc'

134     $this->header .= "Content-Type: multipart/mixed;\n boundary=\"$this->boundary\"\n";                                                                                                                                                 
135     $this->header .= "This is a multi-part message in MIME format.\n";

by

134     $this->header .= "Content-Type: multipart/mixed;\n boundary=$this->boundary\n";
135 

/Elax

Re: pdf sent as text in email

I am a little scared about changing this to be without quotes. Does it work with single quotes?
Did you still have line 135 in your changed file?

/Joe

Re: pdf sent as text in email

I understand your concerns. No it doesn't work with single quote, and for some reason I have to remove line 135 (otherwise it seems that it's added to the boundary). Quote seems to be usefull only when the delimiter contains some dodgy character (like smile so in theory there is no need to.

What is weird, is that I am (apparently ) the only one with this problem.
I'll raise an issue at gmail .

/Elax

Re: pdf sent as text in email

I've fixed the problem by adding the boundary at the end of the header (I've seen that somewhere).
I have no idea why it works but it seems better.

136                 $this->header .= "--".$this->boundary."\n";

/Elax

Re: pdf sent as text in email

Seems there is sparse '\n' just after 'mulitpart/mixed;' in line 134 of class.mail.inc.
Could you check the functionality again on your setup, after fixing this line?
Janusz

Re: pdf sent as text in email

Removing the '\n' doesn't work. Removing the like 133 and 135 works too

/Elax