#26742 [Opn->Fbk]: The base64_encode() function returns an string that cannot decoded by outlook

From: Date: Mon, 29 Dec 2003 15:35:23 +0000
Subject: #26742 [Opn->Fbk]: 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-52584@lists.php.net to get a copy of this message
ID: 26742 Updated by: iliaa@php.net Reported By: eric dot maman at free dot fr -Status: Open +Status: Feedback Bug Type: *URL Functions Operating System: Windows 2000 PHP Version: 4.3.4 New Comment: What is the value of $this->LE ? Previous Comments: ------------------------------------------------------------------------ [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 (#52584) next »