Mauro
2004-01-14 13:11:05 UTC
ho realizzato uno script php che invia il contenuto di un form come attach
dif (da usare con excel) e come normale mail
l'ho testato sul nostro server linux e funziona a meraviglia...
ora che l'ho messo sul server del cliente non va più.. mi dà un allegato del
peso di zero bytes...
qualche anima pia può aiutarmi? il server è Microsoft-IIS/5.0
lo script è questo:
$boundary = strtoupper(md5(uniqid(time())));
$mail_header = "From:$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";
$mail_header .= "\n--$boundary";
$mail_header .= "\nContent-Type: text/plain";
$mail_header .= "\nContent-Transfer-Encoding: 8bit";
$mail_header .= "\n\n$message2";
$file_content = base64_encode($message);
$mail_header .= "\n--$boundary";
$mail_header .= "\nContent-Type: application/x-excel; 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,$subject,"",$mail_header);
grazie
dif (da usare con excel) e come normale mail
l'ho testato sul nostro server linux e funziona a meraviglia...
ora che l'ho messo sul server del cliente non va più.. mi dà un allegato del
peso di zero bytes...
qualche anima pia può aiutarmi? il server è Microsoft-IIS/5.0
lo script è questo:
$boundary = strtoupper(md5(uniqid(time())));
$mail_header = "From:$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";
$mail_header .= "\n--$boundary";
$mail_header .= "\nContent-Type: text/plain";
$mail_header .= "\nContent-Transfer-Encoding: 8bit";
$mail_header .= "\n\n$message2";
$file_content = base64_encode($message);
$mail_header .= "\n--$boundary";
$mail_header .= "\nContent-Type: application/x-excel; 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,$subject,"",$mail_header);
grazie