Send text file contents by e-mail

From: Date: Sun, 06 Aug 2000 16:55:42 +0000
Subject: Send text file contents by e-mail
Groups: php.general 
Request: Send a blank email to php-general+get-10343@lists.php.net to get a copy of this message
I'm trying to send the contents of a text file by e-mail and then replace the file with new content: Here is the code so far, that is not quite working: $fd = fopen( $filename, "a+" ); $contents = fread( $fd, filesize( $filename ) ); // Send the e-mail mail($mek, "Status log", $contents, "From: $mek"); // now replace file contents with the start line for today $StartLine = "Date Time Emails Server"; fputs($fd,$StartLine); fclose($fd); } Any ideas why? Martin

« previous php.general (#10343) next »