我正在運行一個使用file_get_contents的php腳本,以便通過它在遠程文件中的內容發送列表。 如果我手動運行腳本一切正常,但是當我離開它,並等待cron運行它不會得到遠程內容.....這可能嗎? 我在這裏複製位代碼的地方,我認爲這個問題是:cron作業將無法打開file_get_contents
$flyer = file_get_contents('flyer.html');
$desti = $firstname." ".$lastname;
$mail = new phpmailer();
$mail->IsSMTP();
$mail->CharSet = 'UTF-8';
$mail->SMTPAuth = true;
$mail->SMTPSecure = "ssl";
$mail->Host = "orion.xxxx.com"; // line to be changed
$mail->Port = 465; // line to be changed
$mail->Username = '[email protected]'; // line to be changed
$mail->Password = 'xxxx90'; // line to be changed
$mail->FromName = 'Bob'; // line to be changed
$mail->From = '[email protected]';// line to be changed
$mail->AddAddress($email, $desti);
$mail->Subject = 'The Gift Store'; // to be changed
if ($cover_form == '1'){ $mail->MsgHTML($long10);} else
if ($cover_form == '2'){ $mail->MsgHTML($customer);} else
if ($cover_form == '3'){ $mail->MsgHTML($freedoers);} else
if ($cover_form == '4'){ $mail->MsgHTML($freelongform);} else
if ($cover_form == '5'){ $mail->MsgHTML($freestoreshort);} else
if ($cover_form == '6'){ $mail->MsgHTML($getasiteshort);} else
if ($cover_form == '7'){ $mail->MsgHTML($flyer);}
else {}
哪裏'flyer.html'居住?如果它是本地的,你應該使用cron的絕對路徑。 – 2012-02-11 15:24:55