2009/8/20 José de Menezes Soares Neto <z...@detetive.net>: > Hi, thanks for your help... > > Using Zend_Mail is easy, but I got some error trying to send attachments... > the warning is: > > Warning: base64_encode() expects parameter 1 to be string, object given in > C:\www\was\lib\Zend\Mime.php on line 173 > > What it could be? > > My code is: > > // FILE TO BE ATTACHED > > $file = "myfile.xml"; > $filepath = "files/" . $file; > $file_size = filesize($file); > $handle = fopen($file, "r"); > $content = fread($handle, $file_size); fclose($handle); > $content = chunk_split(base64_encode($content));
Maybe try using file_get_contents() and debug that fread() really contains a string. Sounds like it does not. Till