|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-12-29 10:35 UTC] iliaa@php.net
[2004-01-06 20:51 UTC] sniper@php.net
[2004-01-22 14:48 UTC] luis dot cervantes at uspeurope dot com
[2004-03-10 08:49 UTC] louloufox29 at hotmail dot com
[2004-03-10 08:53 UTC] louloufox29 at hotmail dot com
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 09 02:00:01 2025 UTC |
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; }