Chapter 16: Command-Line PHP Utilities 575 $userReminderLogFile ); (Cool web site)
Chapter 16: Command-Line PHP Utilities 575 $userReminderLogFile ); foreach ($mailings as $mail) { $mail = sprintf( %s/%s , $userReminderDir, $mail); if (file_exists($mail)) { if (! doMail($mail, $username)) array_push($logEntries, mail failed! );; } else { array_push($logEntries, cannot find or open $mail ); } } writeLog($userReminderLogFile, $logEntries); } function doMail($file = null, $user = null) { $lines = file($file); $lines = str_replace( rn , n , $lines); $lines = str_replace( r , n , $lines); $lines = str_replace( n , rn , $lines); $today = date( M-d-Y h:i:s A ); $contentTypeSet = FALSE; $message = array(); $headers = array( X-Mailer: . $ XMAILER . rn ); $to = $user; Continued