OK, I've got to send the contents of a file (LINKPMS.txt) to a set of email addresses stored in another file (uploaders.txt) the email addresses are each on a seperate line and LINKPMS.txt will never be more than one line long.
however, when i try to execute the code below, i get a "Warning: file(uploaders.txt) [function.file]: failed to open stream: No such file or directory in \includes\cron\uploaderemails.php on line 4" and then another error when i try to open LINKPMS.txt on line 14, can someone please help me, this is really bugging me as to what the problem is... I've tried having the file names as "./uploaders.txt" and "./LINKPMS.txt", it made no difference... thanks in advance
PHP Code:
<?php
$team_mates="uploaders.txt";
$message="LINKPMS.txt";
$emails=file($team_mates);
for($i=0;$i<count($emails);$i++){
$emails[$i]=trim($emails[$i]);
}
$recipients=implode(",",$emails);
$mail_sub="Auto E-Mail Of Upload Request";
$mail_body=file_get_contents($message);
if($mail_body!="" and $recipients!=""){
if(mail($recipients,$mail_subject,$mail_body,"From: uploadautomailer@l9ianime.com\r\nReply-to: mattcee233@gmail.com")){
$fp=fopen($message);
fwrite($fp,'');
fclose($fp);
}
}
?>
Bookmarks