以下是我從DB發送數據的代碼。請幫我修改。從數據庫中檢索數據並將其作爲Excel工作表使用php
<?
set_time_limit(0);
require("..\class\mime_mail.inc");
unlink("filename.html");
`php -q D:\Inetpub\wwwroot\abc\xyz\getdata.php > filename.html`;
$to = "[email protected]";
$bcc = "[email protected]";
$subject = 'aaaaaa - ' . date("Y-m-d");
$body = join('',file("filename.html"));
$headers = "Content-Type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: [email protected]\r\n";
$headers .= "Bcc:". $bcc ." \r\n";
mail($to, $subject, $body, $headers);
?>
在上面的代碼,訪問getdata.php是檢索在Excel工作表從DB,並存儲數據的文件。它工作正常。上面的代碼是另一個名爲senddata.php的文件。當我運行senddata.php時,我應該收到郵件,但不是上述情況。請幫助....
到底是什麼問題?它會給你一個錯誤信息嗎?一個空白的屏幕?只是不發送電子郵件?您是否嘗試發送到不同的電子郵件帳戶?您是否檢查過SMTP日誌以查看它是否已發送?它是否在您帳戶的垃圾郵件文件夾中? – andrewsi