<?
/************************************************************
*     RomcoMail  verson 1.0b
* A simple script for sending form information via email.
*************************************************************

Copyright (C) 2001  Russ Kruse russ@rkproductions.net

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  
02111-1307, USA.

****************************************************************
*
* Quick setup
*
* Step 1
* Place this entire code block at the top of your html
* form page. Make sure you have a form field called "Name".
*
* Step 2
* Place this in the form tag of your html form without the quotes.
*       "<? echo $PHP_SELF; ?>"
* Example:
* <form name="your_form" method="post" action="<? echo $PHP_SELF; ?>">
*
* Step 3
* Change the varables below */

$mailto=   "foo@emailaddress.com";
$subject=  "subject";
$from=     "bar@email.com";

/* Changing these is optional */

$opening= "Your webpage form sent the following information:";
$footer=  "Form processed by RomcoMail";

/* If set will go to this page after form is sent.
* example:  http://foobar.com/thankyou.html        */

$new_url=  "";


/**************************************************************/


if (isset($Name)){
    if (!is_array($HTTP_POST_VARS)){
    return;
    reset($HTTP_POST_VARS);
    }
      while(list($key, $val) = each($HTTP_POST_VARS)) {
      $GLOBALS[$key] = $val;
      $val=stripslashes($val);
      $content= $content."$key = $val\n";
      }

$message= "$opening\n\n"."$content\n\n".$footer;
mail($mailto, $subject, $content,  "From: $from");

     if (isset($new_url)){
     header ("Location: $new_url");
     }

}
?>