我试图寄送带有多个附件的电子邮件。
This is an example:
$uid = md5(uniqid(time()));
$header = "From: Test <test@test.com>
";
$header .= "MIME-Version: 1.0
";
$header .= "Content-Type: multipart/mixed; boundary="" . $uid . ""
";
$header .= "--" . $uid . "
";
$header .= "Content-type:text/plain; charset=iso-8859-1
";
$header .= "Content-Transfer-Encoding: 7bit
";
$header .= "Test Email
";
$header .= "--" . $uid . "
";
$header .= "Content-Type: text/x-csv; name="1.csv"
";
$header .= "Content-Transfer-Encoding: base64
";
$header .= "Content-Disposition: attachment; filename="1.csv"
";
$header .= $csvfile1 . "
";
$header .= "--" . $uid . "--";
$header .= "Content-Transfer-Encoding: 7bit
";
$header .= "Test Email
";
$header .= "--" . $uid . "
";
$header .= "Content-Type: text/x-csv; name="2.csv"
";
$header .= "Content-Transfer-Encoding: base64
";
$header .= "Content-Disposition: attachment; filename="2.csv"
";
$header .= $csvfile2 . "
";
$header .= "--" . $uid . "--";
$header .= "Content-Transfer-Encoding: 7bit
";
$header .= "Test Email
";
$header .= "--" . $uid . "
";
$header .= "Content-Type: text/x-csv; name="3.csv"
";
$header .= "Content-Transfer-Encoding: base64
";
$header .= "Content-Disposition: attachment; filename="3.csv"
";
$header .= $csvfile3 . "
";
$header .= "--" . $uid . "--";
And I get some strange characters at the end of the csv files, something like this:
w־סֽד·ֽסמ׳fק־ןo,
‰z{©}ךֺxn+¢”j״¶ Eט²¶*Jײֻrֵz°¶+·$j״¶ 5ל†·u+¶+‰ֻ{²װj״¶ ,
问题是什么?
感谢。