phpmailer只能收到一个附件
使用的phpmailer最新版本了,而且我记得好像曾经收到过多个附件,今天测试发现只能收到一个附件了,有没有大侠试过?
<?php
require_once("class.phpmailer.php");
$mail = new PHPMailer();
$mail->IsSMTP(); // send via SMTP
$mail->Host = "smtp.test.com"; // SMTP servers
$mail->SMTPAuth = false; // turn on SMTP authentication
//$mail->Username = "jswan"; // SMTP username
//$mail->Password = "secret"; // SMTP password$mail->CharSet = "GB2312";
$mail->From = "[email protected]";
$mail->FromName = "monitor";
//$mail->AddAddress("[email protected]");
$mail->AddAddress("[email protected]"," test");
//$mail->AddAddress("[email protected]"); // optional name
//$mail->AddReplyTo("[email protected]","Information");
//$mail->WordWrap = 50; // set word wrap
//$date="2009-04-18";
$date=date("Y-m-d",time()-86400);
//$mail->AddAttachment("/var/www/jpgraph/html/report_bj_2009-04-19.html"); // attachment
//$mail->AddAttachment("/var/www/jpgraph/html/report_gz_2009-04-19.html"); // attachment
//$mail->AddAttachment("/var/www/jpgraph/html/report_sz_2009-04-19.html"); // attachment
$mail->AddAttachment("/var/www/jpgraph/html/report_bj_$date.html"); // attachment
$mail->AddAttachment("/var/www/jpgraph/html/report_gz_$date.html"); // attachment
$mail->AddAttachment("/var/www/jpgraph/html/report_sz_$date.html"); // attachment //$mail->AddAttachment("/tmp/image.jpg", "new.jpg");
$mail->IsHTML(true); // send as HTML
$mail->Subject = "»°·Ñͳ¼Æ($date)";
$mail->Body = "¸½¼þΪ $date »°·Ñͳ¼Æ¡£<br><br>
¸ü¶à»°·Ñͳ¼ÆÇë²Î¼û£º<br><br>
±±¾©£º<a href=http://192.168.15.144/jpgraph/html/index_bj.html>http://192.168.15.144/jpgraph/html/index_bj.html</a><br>
¹ãÖÝ£º<a href=http://192.168.15.144/jpgraph/html/index_gz.html>http://192.168.15.144/jpgraph/html/index_gz.html</a><br>
ÉîÛÚ£º<a href=http://192.168.15.144/jpgraph/html/index_sz.html>http://192.168.15.144/jpgraph/html/index_sz.html</a><br>";
$mail->AltBody = "This is the text-only body";
if(!$mail->Send())
{
echo "Message was not sent <p>";
echo "Mailer Error: " . $mail->ErrorInfo;
exit;
}
echo "Message has been sent";
?>
使用的phpmailer最新版本了,而且我记得好像曾经收到过多个附件,今天测试发现只能收到一个附件了,有没有大侠试过?
<?php
require_once("class.phpmailer.php");
$mail = new PHPMailer();
$mail->IsSMTP(); // send via SMTP
$mail->Host = "smtp.test.com"; // SMTP servers
$mail->SMTPAuth = false; // turn on SMTP authentication
//$mail->Username = "jswan"; // SMTP username
//$mail->Password = "secret"; // SMTP password$mail->CharSet = "GB2312";
$mail->From = "[email protected]";
$mail->FromName = "monitor";
//$mail->AddAddress("[email protected]");
$mail->AddAddress("[email protected]"," test");
//$mail->AddAddress("[email protected]"); // optional name
//$mail->AddReplyTo("[email protected]","Information");
//$mail->WordWrap = 50; // set word wrap
//$date="2009-04-18";
$date=date("Y-m-d",time()-86400);
//$mail->AddAttachment("/var/www/jpgraph/html/report_bj_2009-04-19.html"); // attachment
//$mail->AddAttachment("/var/www/jpgraph/html/report_gz_2009-04-19.html"); // attachment
//$mail->AddAttachment("/var/www/jpgraph/html/report_sz_2009-04-19.html"); // attachment
$mail->AddAttachment("/var/www/jpgraph/html/report_bj_$date.html"); // attachment
$mail->AddAttachment("/var/www/jpgraph/html/report_gz_$date.html"); // attachment
$mail->AddAttachment("/var/www/jpgraph/html/report_sz_$date.html"); // attachment //$mail->AddAttachment("/tmp/image.jpg", "new.jpg");
$mail->IsHTML(true); // send as HTML
$mail->Subject = "»°·Ñͳ¼Æ($date)";
$mail->Body = "¸½¼þΪ $date »°·Ñͳ¼Æ¡£<br><br>
¸ü¶à»°·Ñͳ¼ÆÇë²Î¼û£º<br><br>
±±¾©£º<a href=http://192.168.15.144/jpgraph/html/index_bj.html>http://192.168.15.144/jpgraph/html/index_bj.html</a><br>
¹ãÖÝ£º<a href=http://192.168.15.144/jpgraph/html/index_gz.html>http://192.168.15.144/jpgraph/html/index_gz.html</a><br>
ÉîÛÚ£º<a href=http://192.168.15.144/jpgraph/html/index_sz.html>http://192.168.15.144/jpgraph/html/index_sz.html</a><br>";
$mail->AltBody = "This is the text-only body";
if(!$mail->Send())
{
echo "Message was not sent <p>";
echo "Mailer Error: " . $mail->ErrorInfo;
exit;
}
echo "Message has been sent";
?>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货