Re: Process File to file values, then mail file as HTML EMail

From: Date: Mon, 07 Apr 2003 12:14:01 +0000
Subject: Re: Process File to file values, then mail file as HTML EMail
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-142685@lists.php.net to get a copy of this message
$contents = fread ($handle, filesize ($filename)); (cut...) mail($SendEMail, $MessageSubject, $contents, $mailheaders);
If this part "Dear $_GET['ToName']," is in the read file, than it is read into $contents and directly put into the mail. At no place are you asking PHP to replace the variable name with its value. You could place a simple code in the file like ##ToName##, then do a $contents=str_replace('##ToName##',$_GET['ToName'], $contents); To make it more flexible than having to write a line for everything you could have in the file you could have a look at how templates work. Or dig into regular expressions. Chris H.

« previous php.general (#142685) next »