#!/usr/bin/perl
## make sure the path to pearl is correct above. ##

##########################################################################################
##  FILE: bizmail.cgi                                                                   ##
##                                                                                      ##
##  BizMailForm Premium                           Version 3.0.1                         ##
##  ©Copyright 2000-2006+ Seth Michael Knorr      mail@sethknorr.com                    ##
##                                                                                      ##
##                       http://www.bizmailform.com/                                    ##
##         Please contact me with any bugs found, or any bug fixes.                     ##
##                                                                                      ##
##########################################################################################
##                                                                                      ##
##  There is no email support provided for this script, the only support can be         ##
##  found at our web site: http://www.bizmailform.com/                                  ##
##                                                                                      ##
##  REDISTRIBUTION OF ANY KIND IS PROHIBITED WITH OUT THE CONSENT OF SETH KNORR.        ##
##                                                                                      ##
##  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND     ##
##  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED       ##
##  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  ##
##  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,     ##
##  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT  ##
##  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR  ##
##  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,   ##
##  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT  (INCLUDING NEGLIGENCE OR OTHERWISE) ##
##  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE          ##
##  POSSIBILITY OF SUCH DAMAGE.                                                         ##
##                                                                                      ##
##########################################################################################


#----- FULL SERVER PATH TO CGI-BIN -----#

##  IF YOU ARE HAVING PROBLEMS RUNNING BIZ MAIL FORM TRY INSERTING THE
##  "ABSOLUTE SERVER PATH" TO YOUR CGI-BIN BELOW... **OTHERWISE LEAVE THIS BLANK, WHICH IS THE DEFAULT.
##  When adding a path you must use a trailing forward slash:
##  ie. /home/www/cgi-bin/
##  You may need to check with your web host or systems admin for this.
##  NOTE: this may be necessary for windows users...

$ABSOLUTE_PATH_TO_CGI_BIN = "";



#----- S E N D M A I L   &   S M T P   S E T T I N G S  -----#

## $useLib defines the method of sending the email auto response and email form info.   ##       
## Set $useLib = "sendmail"; TO USE THE SENDMAIL METHOD
## Set $useLib = "smtp"; TO USE THE SMTP METHOD

$useLib = "sendmail";

## BELOW CONFIGURED IF $useLib = "sendmail"; ##

$mailprog = "/usr/lib/sendmail"; ## $mailprog = path to Sendmail on your server  ##


## BELOW CONFIGURED IF $useLib = "smtp"; ##

$smtp_server = "smtp.yourdomain.com";  ## $smtp_server = smtp server address     ##


#----- F R O M   N A M E   O N   R E P L Y   E M A I L  -----#

##  $reply_from_name =  from name that will apear on the auto response email.  ##

        $reply_from_name = "Full Name";


#----- F R O M   E M A I L   O N   D A T A   R E S U L T S   E M A I L  -----#

# Set $send_from_poster = "1"; To use posters email address as the from email # 
# Set $send_from_poster = "2"; To use $FROM_results_email as the from email   #

	$send_from_poster = "1";

        $FROM_results_email = "you\@yourdomain.com";


#----- S E N D   T O    E M A I L   S E T U P  -----#

## $sendto{"1"} is Where form submissions will be sent,                                 ##
## (REMEMBER THE \ BEFORE THE @ SIGN)                                                   ##
## This is also the reply address used in the auto response email sent to the person    ## 
## filling out the form.                                                                ## 


        $sendto{"1"} = "mail\@yourdomain.com";  ## (REMEMBER THE \ BEFORE THE @ SIGN)##
        $sendto{"2"} = "mail2\@yourdomain.com";
        $sendto{"3"} = "mail3\@yourdomain.com";
        $sendto{"4"} = "mail4\@yourdomain.com";
        $sendto{"5"} = "mail5\@yourdomain.com";



#----- C A R B O N   C O P I E D    E M A I L   S E T U P  -----#

## $cc_to  Is an optional field. If you want to carbon copy form information to a       ##
## second email address, enter a value above. If you do not want to carbon copy the     ##
## form submissions, leave the value blank.                                             ##

        $cc_to{"1"} = "ccmail\@yourdomain.com";
        $cc_to{"2"} = "ccmail2\@yourdomain.com";
        $cc_to{"3"} = "";
        $cc_to{"4"} = "";
        $cc_to{"5"} = "";


#-----  S E T   O K   S U B M I S S I O N   U R L -----#

        $setokurl = "0";

## to use @okurls to verify the url the form is submited by set $setokurl = "1"; and      ##
## set $setokurl = "0"; if you do not want to use @okurls to verfiy form submission URL   ##

## This feature has been updated.  Read the readme file for more information.               ##

        @okurls = ("http://www.yourdomain.com/", "http://yourdomain.com/", "https://yourdomain.com/", "https://www.yourdomain.com/");


#########################################################################
###                                                                   ###
###         O P T I O N A L    V A R I A B L E S    B E L O W         ###
###                                                                   ###
#########################################################################


#----- U S E   P E R S O N A L I Z E D   E R R O R   F O R M   P A G E -----#

## set $use_html_error = "2"; to not use the personalized html form error page template ##
## (DEFAULT) set $use_html_error = "1"; to use the personalized html form error page template ##

$use_html_error = "1";

$HTML_error_page{"1"} = "formerror.html";
$HTML_error_page{"2"} = "";
$HTML_error_page{"3"} = "";
$HTML_error_page{"4"} = "";
$HTML_error_page{"5"} = "";




#----- D E F A U L T   H T M L   E R O R   P A G E   T E M P L A T E  -----#

$MY_error_page = "error.html";   # HTML error page you configured  ##



#----- P R I N T   B L A N K   F I E L D S -----#

## set $PRNT_blankfields = "2"; to not send & leave out blank form field results to your email ##
## (DEFAULT) set $PRNT_blankfields = "1"; to send blank form field results to your email ##

$PRNT_blankfields = "1";


#----- D A T A   F I L E   L O C A T I O N  -----#

## $datafile{"1"} & $datafile{"2"} is the file name of the data file that form data will get sent to.  ##

        $datafile{"1"} = "bizmail.dat";
        $datafile{"2"} = "";
        $datafile{"3"} = "";
        $datafile{"4"} = "";
        $datafile{"5"} = "";

#----- S E N D    R E S U L T S   T O   D A T A   F I L E  -----#

## set $send_data_results = "2"; to not send form results to the data file ##
## (DEFAULT) set $send_data_results = "1"; to send form results to the data file ##

$send_data_results = "1";



#----- S E N D    P L A I N   T E X T   M E S S A G E   F I L E  -----#

## $PLAIN_mes_file{"1"} or $PLAIN_mes_file{"2"} ... Specify the file name of the Plain Text   ##
## Auto-Response email that will be sent if PLAIN TEXT is specified. The message is selected  ##
## by what is inserted into the hidden form field:                                            ##
##                                        ##
## NOTE: If this field is not used in the form the default Plain Text file used is: plain.mes ## 

        $PLAIN_mes_file{"1"} = "plain.mes";
        $PLAIN_mes_file{"2"} = "";
        $PLAIN_mes_file{"3"} = "";
        $PLAIN_mes_file{"4"} = "";
        $PLAIN_mes_file{"5"} = "";


#----- S E N D   E M A I L   R E S U L T S   T O   Y O U R   E M A I L  -----#

## set $send_email_results = "2"; to not send form results to your email ##
## (DEFAULT) set $send_email_results = "1"; to send form results to your email ##

$send_email_results = "1";



#----- I G N O R E   D U P L I C A T E   E N T R I E S   I N   D A T A F I L E -----#

##  $delete_dups = "1";  ##  Will delete all duplicates sent to the data file.   ##
##  $delete_dups = "2";  ##  To leave duplicate posts (DEFAULT - MOST COMMON CHOICE)  ## 
##  A duplicate is determined by the email field if this is set for datafile.  ##

	$delete_dups = "2";  # USHUALY, IT IS ONLY SET TO 1 FOR PEOPLE GENERATING LEADS ##




###########################################################################
####                                                                    ###
####   N O   N E E D   T O   E D I T  V A R I A B L E S   B E L O W     ###
####                                                                    ###
###########################################################################