crofthunter
New member
Hallöle
ich versuche gerade krampfhaft mit der PEAR klasse eine Email mit PDF als Attachment zu verschicken. Also es kommt auch was an. Allerdings ist anstatt eines Attachment nur mörderlanges encodiertes Zeugs drin.
hier der Code:
<?php
/*
*zur Info
ear ist nicht standardmässig auf dem Server installiert
*wird deshalb über absolute Serverpfade includiert
*/
include ($cfg["pearmail"]);
include ($cfg["pearmailmime"]);
$text = $arrRS["email_text"];
$html = "<html><body>".$arrRS["email_text"]."</body></html>";
$file = $arrRS["pdf_url"];
//echo $file; exit;
$crlf = "\r\n";
$hdrs = array('From' => $cfg["cci_standardmail"], 'Subject' => $arrRS["email_subject"]);
$mime = new Mail_mime ($crlf);
$mime->setTXTBody($text);
$mime->setHTMLBody($html);
$mime->addAttachment($file,'application/octed-stream');
$body = $mime->get();
$hdrs = $mime->headers($hdrs);
$mail =& Mail::factory('mail');
$mail->send($_POST["email"],$hdrs,$body);
?>
vielleicht hat ja jemand ne Idee
ich versuche gerade krampfhaft mit der PEAR klasse eine Email mit PDF als Attachment zu verschicken. Also es kommt auch was an. Allerdings ist anstatt eines Attachment nur mörderlanges encodiertes Zeugs drin.
hier der Code:
<?php
/*
*zur Info
*wird deshalb über absolute Serverpfade includiert
*/
include ($cfg["pearmail"]);
include ($cfg["pearmailmime"]);
$text = $arrRS["email_text"];
$html = "<html><body>".$arrRS["email_text"]."</body></html>";
$file = $arrRS["pdf_url"];
//echo $file; exit;
$crlf = "\r\n";
$hdrs = array('From' => $cfg["cci_standardmail"], 'Subject' => $arrRS["email_subject"]);
$mime = new Mail_mime ($crlf);
$mime->setTXTBody($text);
$mime->setHTMLBody($html);
$mime->addAttachment($file,'application/octed-stream');
$body = $mime->get();
$hdrs = $mime->headers($hdrs);
$mail =& Mail::factory('mail');
$mail->send($_POST["email"],$hdrs,$body);
?>
vielleicht hat ja jemand ne Idee