Hi @ all,
Ich habe für meine Neue Version meine FormMail Klasse jetzt noch das Datein schicken mit rein gebastelt. Nun ich das meine Sendmail funktion.
Nun ist das Problem das der Anhang beim Outlook-Express noch so komisch ausgegeben wird .... wenn ich das ganze aber z.B. an Outlook sende ist es ganz normal. Stimmt da irgentwas mit den headers nicht?
PS: getFile() Gibt die Datei zurück
$this->mail[$type] ist der Mail-text
MFG Tim[/code]
Ich habe für meine Neue Version meine FormMail Klasse jetzt noch das Datein schicken mit rein gebastelt. Nun ich das meine Sendmail funktion.
PHP-Code:
function send_mail($an, $von, $titel, $type){
$type=strtolower($type);
if($type != 'html' AND $type != 'text') $this->err('Falscher Mail Typ! Bitte html oder text');
if($this->mail){
// HTML ergänzuung Zum deaktivieren einfach auskommentieren
$this->mail['html'] = "<html><head>
<style type=\"text/css\">\n
.key {font-family: Verdana; color:black; font-size: 11px; padding-right:5px;}\n
.data {font-family: Verdana; color:grey; font-size: 12px;}\n
</style>\n
</head><body>".$this->mail['html']."</body></html>";
//*/
$headers = array();
if($type == 'html'){
$headers['mime-version'] = "MIME-Version: 1.0";
$headers['content-type'] = "Content-type: text/html; charset=iso-8859-1\n";
$headers['from'] = "From: ".$von."\n";
}else{ // if else
$headers['mime-version'] = "MIME-Version: 1.0\n";
$headers['content-type'] = "Content-type: text/plain; charset=iso-8859-1\n";
$headers['from'] = "From: ".$von."\n";
} // if
if($this->option['file_name']){
$tempi = $this->mail[$type];
$msgtmp = "--FormMail\n";
$msgtmp .= "Content-type: text/plain; name=\"".$this->option['file_name']."\"\n";
$msgtmp .= "Content-transfer-encoding: base64\n\n";
$msgtmp .= chunk_split(base64_encode($this->getFile($this->option['file_tmp'].$this->option['file_name'])))."\n\n";
$this->mail[$type] = "--FormMail\n";
$this->mail[$type] .= $headers['content-type'] . "\n";
//$this->mail[$type] .= $msg .= "Content-Transfer-Encoding: 8bit\n\n";
$this->mail[$type] .= $tempi . "\n\n";
$headers['content-type'] = "Content-type: multipart/mixed; boundary=\"FormMail\"";
$this->mail[$type] .= $msgtmp . "\n\n";
$this->mail[$type] .= "--FormMail--";
} // if
$header = "";
foreach($headers as $value) {
$header .= $value . "\n";
} // foreach
if(!is_array($an)){
$arr = explode(',', $an);
$an = array();
for($b = 0; $b < sizeof($arr); $b++) // for
if($arr[$b] != "") array_push($an, trim($arr[$b]));
} // if
for($a = 0; $a < sizeof($an); $a++){
if(@mail($an[$a],$titel,$this->mail[$type],$header))
$back = true;
else // if
$back = false;
} // for
return $back;
}else $this->err('Bitte vor send_mail noch gen_mail aufrufen!');
} // function
PS: getFile() Gibt die Datei zurück
$this->mail[$type] ist der Mail-text
MFG Tim[/code]

Kommentar