After some testing I found that the EncodeFile function within the phpmailer class is doing some strange magic_quotes stuff. It seems to screw up something and this results in missing content when sending mails with attachments using phpmailer with amfphp.

I just removed all the magic quotes stuff and this simple function seems to work fine for me now:

/* fix for using phpmailer and amfphp together on php5 **/
private function EncodeFile($path, $encoding = 'base64') {
return $file_buffer = $this->EncodeString( file_get_contents($path) , $encoding);