[TYPO3-german] directmail attachment bigger / größer 500k

Philipp Fath philipp.fath at gmail.com
Sat Feb 24 23:58:55 CET 2007


Hey Guido,

danke für deinen Tipp. Habe es mit folgendem Skript getestet:

[code]
<?php
$file = "datei.pdf";
$file_name = "wie_soll_anhang_heissen.pdf";
$from = "adresse at example.com";
$to = "adress at example.com";
$message = "Hier steht dann die Nachricht der Mail";
$boundary = strtoupper(md5(uniqid(time())));
$mail_header  = "From:Test <$from>\n";
$mail_header .= "MIME-Version: 1.0";
$mail_header .= "\nContent-Type: multipart/mixed; boundary=$boundary";
$mail_header .= "\n\nThis is a multi-part message in MIME format  --
Dies ist eine mehrteilige Nachricht im MIME-Format";
$mail_header .= "\n--$boundary";
$mail_header .= "\nContent-Type: text/plain";
$mail_header .= "\nContent-Transfer-Encoding: 8bit";
$mail_header .= "\n\n$message";
$file_content = fread(fopen($file,"r"),filesize($file));
$file_content = chunk_split(base64_encode($file_content));
$mail_header .= "\n--$boundary";
$mail_header .= "\nContent-Type: application/octetstream; name=\"$file_name\"";
$mail_header .= "\nContent-Transfer-Encoding: base64";
$mail_header .= "\nContent-Disposition: attachment; filename=\"$file_name\"";
$mail_header .= "\n\n$file_content";
$mail_header .= "\n--$boundary--";
mail($to,"Betreff",$message,$mail_header);
?>
[/code]

Es hat problemlos funktioniert. Es ist weder das pdf noch der server
noch meine Mailbox. Es muß also definitiv an typo3 liegen. Das PDF war
in dem Fall 1MB groß und es wird auch so von meiner Mailbox angezeigt.

Bin für weitere Ideen und Vorschläge dankbar.

Grüße Philipp


More information about the TYPO3-german mailing list