#26742 [Com]: The base64_encode() function returns an string that cannot decoded by outlook

From: Date: Wed, 10 Mar 2004 13:49:44 +0000
Subject: #26742 [Com]: The base64_encode() function returns an string that cannot decoded by outlook
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-56228@lists.php.net to get a copy of this message
ID: 26742 Comment by: louloufox29 at hotmail dot com Reported By: eric dot maman at free dot fr Status: No Feedback Bug Type: *URL Functions Operating System: Windows 2000 PHP Version: 4.3.4 New Comment: I have the same problem (using PHP 4.3.3 with Easy PHP on a win XP server) When i send the attachment using Outlook, the part of message source about attachement is different. The string is not the same... (that's why it seems sorrupted). I've try to encode a file and then decode the same file, save it using a different name and can't open it, it is the same probleme. So i think it's realy a PHP Bogus (i can't believe in the config way of resolution...) Regards ! Previous Comments: ------------------------------------------------------------------------ [2004-01-22 14:48:32] luis dot cervantes at uspeurope dot com Hi. I have the same problem with function. Can you tell me how you resolved the problem. Its is possible that the problem is the instalation of php. mimetypes, etc. Thanks for all. Luis ------------------------------------------------------------------------ [2004-01-06 20:51:46] sniper@php.net No feedback was provided. The bug is being suspended because we assume that you are no longer experiencing the problem. If this is not the case and you are able to provide the information that was requested earlier, please do so and change the status of the bug back to "Open". Thank you. ------------------------------------------------------------------------ [2003-12-29 10:35:22] iliaa@php.net What is the value of $this->LE ? ------------------------------------------------------------------------ [2003-12-29 09:32:14] eric dot maman at free dot fr Description: ------------ I am using the base64_encode() function to send attachements by email. When I receive the mail on Outlook, the attachement is visible but corrupeted. I have tested the whole process and my conclusion is that the base64_encode() function does not work correctly. I have made a workarround with an extrenal program that performs the base64 encoding and it work correctly. Reproduce code: --------------- function EncodeString ($str, $encoding = "base64") { $encoded = ""; switch(strtolower($encoding)) { case "base64": $encoded = chunk_split(base64_encode($str), 76, $this->LE); break; case "7bit": case "8bit": $encoded = $this->FixEOL($str); if (substr($encoded, -(strlen($this->LE))) != $this->LE) $encoded .= $this->LE; break; case "binary": $encoded = $str; break; case "quoted-printable": $encoded = $this->EncodeQP($str); break; default: $this->SetError($this->Lang("encoding") . $encoding); break; } return $encoded; } ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=26742&edit=1

« previous php.bugs (#56228) next »