在过去的几个小时里,我一直在尝试在电子邮件中创建一个动态表。我一直没有成功,我尝试在正文变量内外创建表并在其中回显它,但我没有成功把我的代码放在下面..任何帮助都会非常感谢..我要做的就是创建一个包含一些mysql数据的表,然后将它发送给一些客户..这只是我一直在尝试完成的事情
$link = mysql_connect('localhost', 'root', '');
mysql_select_db('netbookdb');
$sql="SELECT * FROM rep_log WHERE s_date = '2012-05-31'";
$result=mysql_query($sql, $link);
$date=date('dmy');
require("../PHPMailer/class.phpmailer.php");
$mail = new PHPMailer();$mail = new PHPMailer();
$mail->IsSMTP(); // set mailer to use SMTP
$mail->Host = "smtp"; // specify main and backup server
$mail->From = "support@.vic.edu.au";
$mail->FromName = "Ict Devices";
$mail->AddAddress("email@h.vic.edu.au", "Matthew");
$mail->Subject = "Damage Log Report";
$mail->IsHTML(true);
$var='xlsx';
$date=date('dmy.');
$mail->Body = " while($rows=mysql_fetch_array($result)){
$cases=$rows['cases'];
$hg=$rows['hg'];
$surname=$rows['surname'];
$firstname=$rows['firstname'];
$claim=$rows['claim'];
$damage=$rows['damage'];
$cost=$rows['cost'];
}";
$mail->AltBody="Please Use a Html Compaible Email Veiwer";
if(!$mail->Send())
{
echo "Error sending: " . $mail->ErrorInfo;;
}
else
{
echo "Letter is sent";
}