remove the To:$email from $headers. You have it already in the $to parameter.
----- Original Message ----- From: "Edward Bailey" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, April 22, 2002 11:48 AM Subject: [PHP] script executeion problem - executes twice for no reason - help > Please excuse my ignorance, this is probably a simple > problem but I have no idea what to do next. > > I wrote the following to send an automated response to > users that fill out a form, select submit and that > triggers the conditional "if" statement and then the > script sends an HTML based newsletter to the user. The > script does work, but it sends out TWO newsletters > instead of one and I have no idea why. I have used the > code below in several different forms and it does the > same thing each time so I would assume the code is the > problem. > > > if() > {$filename = "../includes/news.html"; > $to = "$email"; > $subject = "Newsletter"; > $fd = fopen ($filename, 'r'); > $message = fread ($fd, > fileSize("../includes/news.html")); > fclose ($fd); > $headers = "To: $email\nFrom: $from\nReply-To: > $reply_address\nMIME-Version: 1.0\nContent-type: > text/html; charset=iso-8859-1\n"; > mail($to, $subject, $message, $headers); > } > > Can anyone help me or point me in the right direction? > > Thanks > > Ed > > > __________________________________________________ > Do You Yahoo!? > Yahoo! Games - play chess, backgammon, pool and more > http://games.yahoo.com/ > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php