Link to home
Start Free TrialLog in
Avatar of pmrussell892
pmrussell892

asked on

bizmail.cgi wont carbon copy forms

Can an expert please help me spot the error in my bizmail.cgi configuration.

I cannot get my form to CC to other email addresses or get the autoresponse email to go out. I think I have been working on it to hard and am missing something somewhere. Only email i can get it to send out is to the main email address. Please help me, this is important.

Host details:

windows server
smtp set to localhost
cgi is enabled

================================
bizmail.cgi
================================

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

##########################################################################################
##  FILE: bizmail.cgi                                                                   ##
##                                                                                      ##
##  BizMailForm                                   Version 2.2.2                         ##
##  ©Copyright 2000-2005+ 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/                                  ##
##                                                                                      ##
##                                                                                      ##
##  ANY PERSON(S) MAY USE AND MODIFY THESE SCRIPT(S) FREE OF CHARGE FOR EITHER BUSINESS ##
##  OR PERSONAL, HOWEVER AT ALL TIMES HEADERS AND COPYRIGHT MUST ALWAYS REMAIN INTACT.  ##
##                                                                                      ##
##  REDISTRIBUTION FOR PROFIT IS PROHIBITED WITH OUT THE CONSENT OF SETH KNORR.         ##
##                                                                                      ##
##  By using this code you agree to indemnify Seth M. Knorr from any liability that     ##
##  might arise from its use.                                                           ##
##                                                                                      ##
##########################################################################################
##                                                                                      ##
##                       MIME Lite.pm copyright information below:                      ##
##                                                                                      ##
## Eryq (F<eryq@zeegee.com>).President, ZeeGee Software Inc. (F<http://www.zeegee.com>).##
##                                                                                      ##
##########################################################################################
##                                                                                      ##
##               T H A N K   Y O U   I N   A D V A N C E   F O R                        ##
##                 S U P P O R T I N G   M Y   S P O N S O R S                          ##
##                                                                                      ##
##########################################################################################


#----- 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 = "//fp/home/users/web/b260/{username}/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 = "smtp";

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

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


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

$smtp_server = "localhost";  ## $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 = "Kowalski Furniture Design";


#----- 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 = "2";

        $FROM_results_email = "rckfd\@charter.net";


#----- 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 to person filling out the   ##
## form.                                                                                ##


        $sendto{"1"} = "darceya@charter.net";## (REMEMBER THE \ BEFORE THE @ SIGN)##
        $sendto{"2"} = "rckfd@charter.net";



#----- 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"} = "rckfd@charter.net";


#-----  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.kowalskifurnituredesign.com/", "http://kowalskifurnituredesign.com/", "https://kowalskifurnituredesign.com/", "https://www.kowalskifurnituredesign.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 = "2";

$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";

#----- 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 = "2";



#----- 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:                                            ##
## <input type="hidden" name="plain_mesfile" value="1">                                       ##
## 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";


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

## $HTML_mes_file{"1"} or $HTML_mes_file{"2"} ... Specify the file name of the HTML           ##
## Auto-Response email that will be sent if HTML is specified. The message is selected        ##
## by what is inserted into the hidden form field:                                            ##
## <input type="hidden" name="html_mesfile" value="1">                                        ##
## NOTE: If this field is not used in the form the default HTML file used is: html.mes        ##

        $HTML_mes_file{"1"} = "../CGI-BIN/html.mes";


#----- 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";


#----- D E L E T E   D U P S -----#

## $delete_dups = "1";  will delete all dups.    ##
## To leave duplicate posts set $delete_dups = "2"; (DEFAULT - MOST COMMON CHOICE)  ##
##  (A duplicate is determined by the email field.)  ##

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



#-----  F I L E   A T T A C H M E N T -----#

## $send_attachement specifys if you want to send an attachment with the auto response. ##
## Set $send_attachement = "1"; to send attachment with autoresponse                    ##
## Set $send_attachement = "2"; to not send attachment with autoresponse                ##

      $send_attachement = "2";

## IF USING A FILE ATTACHMENT YOU MUST CONFIGURE THE BELOW THREE VARIABLES              ##

$attachment_nm = "page.pdf";  ## file name of attachement ##

$att_path = "/path/to/attachment/";  ## Path to file attachement WITH TRAILING / ##

$att_format = ".pdf";  ## File attachement extension, or file type (basicaly .exstension ) ##


# $att_content_type IS THE CONTENT-TYPE OF THE ATTACHMENT #

      $att_content_type = "pdf"; # FORMAT FOR A "PDF" #

      # $att_content_type = "text/html";
      # $att_content_type = "image/gif"; # FORMAT FOR A "GIF IMAGE" #
      # $att_content_type = "image/jpeg"; # FORMAT FOR A "JPEG IMAGE" #
      # $att_content_type = "image/png"; # FORMAT FOR A "PNG IMAGE" #
      # $att_content_type = "zip"; # FORMAT FOR A "ZIP" #


#----- S E R V E R   T I M E   Z O N E   H O U R   O F F   S E T -----#

## USED IF YOUR SERVER TIME IS FAST OR SLOW.  ##

## TO NOT USE THIS FEATURE SET $HOUR_offset = "0"; (DEFAULT) ##
## ENTER + OR - THE AMOUNT OF HOURS TO OFFSET YOUR SERVERS HOUR BY ##

$HOUR_offset = "0";

      ## EXAMPLES:
      ## $HOUR_offset = "+1";
      ## $HOUR_offset = "-1";



###########################################################################
####                                                                    ###
####   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     ###
####                                                                    ###
###########################################################################


$CGI_error = "error.cgi";
$CGI_required = "required.cgi";
$CGI_smtp = "smtp.cgi";
$CGI_sendmail = "sendmail.cgi";



$versionnumber = "Version 2.2.2";
$footer = "You can close this window";

   $offset = @_;
    $offset=$offset*86400;

    ($sec, $min, $hour, $dayofmonth, $mon, $year, $weekday, $dayofyear, $IsDST) = localtime(time + $offset);
    $year = $year + 1900;
    @months = ("JA", "FB", "MR", "AP", "MY", "JN", "JL", "AG", "SP", "Oc", "NV", "DE");
    $monthname = $months[$mon];
    @monthsnum = ("1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12");
    $monthnamenum = $monthsnum[$mon];

    @monthsactual = ("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
    $monthnameactual = $monthsactual[$mon];


    @days = ("Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday");
    $dayname = $days[$weekday-1];

${'monthname'} = "$monthname";
${'monthnamenum'} = "$monthnamenum";
${'dayofmonth'} = "$dayofmonth";


$month = "$monthnamenum";


## CALCULATE IF IT IS A LEAP YEAR ##

     if (isleap((localtime(time))[5])) {
     $IS_leapyear = "1";
     }else{
     $IS_leapyear = "";
     }


     sub isleap     {
          my ($year) = @_;
          $year += 1900;
          return 1 if ( ($year % 4 == 0) &&
               ( ($year % 100) || ($year % 400 == 0) ) );
          return 0;
     }

## END CALCULATE IF IT IS A LEAP YEAR ##


if ($IS_leapyear) {
$FEB_days = "29";
}else{
$FEB_days = "28";
}

@NUM_month_days = ("0", "31", "$FEB_days", "31", "30", "31", "30", "31", "31", "30", "31", "30", "31");

$month++;
$month--;


if (! $HOUR_offset || $HOUR_offset eq "0"){}else{

$hour=$hour+24;
$hour=$hour+$HOUR_offset;

      if ($hour < "24") {
            if ($day eq "$NUM_month_days[$month]") {
                  if ($month < "12") {
                  $month--;
                  }else{
                  $month = "1";
                  $year++;
                  }
            $day--;
            }else{
            $day--;
            }
      }
      elsif ($hour > "24") {
            if ($day eq "1") {
                  if ($month == "1") {
                  $month = "12";
                  $year--;
                  }else{
                  $month--;
                  }
            $day=$day+$NUM_month_days[$month]; ## ADD NEXT MONTHS DAYS TO HERE ##
            }
      $day--;  ## SUBTRACT ONE DAY
      $hour=$hour-24;
      }else{
      $hour=$hour-24;
      }
}

      if ($hour eq "12"){
      $newhour = "$hour";
      $nightday = "PM";
      }
      elsif ($hour > 12){
      $newhour = ($hour-12);
      $nightday = "PM";
      }else{
      $newhour=$hour;
      $nightday = "AM";
      }

$hourplus="$newhour";
${'hour'}=$newhour;

if ($min <= 9){
$newmin = "0$min";
}else{
$newmin = "$min";
}


if($ENV{'REQUEST_METHOD'} eq "GET" || ! $ENV{'REQUEST_METHOD'}) {
require "$ABSOLUTE_PATH_TO_CGI_BIN$CGI_error";
&nopost;
}
elsif($ENV{'REQUEST_METHOD'} eq "POST") {
&get_form_data;
&main;
}else{

print "Content-type: text/html\n\n";
print "<font size=\"+1\"><center>Your server is MIS-CONFIGURED, and is not running the tag <b>\$ENV{'REQUEST_METHOD'}</b> properly <br><br>";
print "Please check with your Host or Systems Administrator to fix this problem.</font></center>";
exit;
}


sub get_form_data {

      read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
      $buffer =~ s/\%2B/±/g;  ## CONVERT + SIGNS TO ± TO BE LATTER CONVERTED BACK ##
      @pairs=split(/&/,$buffer);
      foreach $pair (@pairs)
      {
            @a = split(/=/,$pair);
            $name=$a[0];
            $value=$a[1];
            $value2=$a[1];
            $name =~ s/\+/ /g;
            $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
            $value =~ s/~!/ ~!/g;
            $value =~ s/\+/ /g;
            $value =~ s/(\r)+/\-\-/g;
            $value =~ s/\n+//g;
            $value =~ s/(\-\-)+/\n/g;
                $value =~ s|<|\&lt\;|g;       # convert all '<' to "&lt\;"
                $value =~ s|>|\&gt\;|g;              # convert all '>' to "&gt\;"

            $value =~ s/\+/ /g;      # convert + signs to spaces #
            $value =~ s/±/\+/g;      # RE-convert ± signs BACK to + #

## $value2 is used in variables of data sent to the data file##
            $value2 =~ s/(\")+/``/g; #V1.5 Bug Fix - Converts " to `` in data file #
            $value2 =~ s/(')+/`/g; #V1.8 Bug Fix - Converts ' to ` in data file #
            $value2 =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
                $value2 =~ s|\n|<br>\n|g;      # convert all line feeds to "<br>" and line feed  #
            #$value2 =~ s/~!/ ~!/g;
            $value2 =~ s/\+/ /g;      # convert + signs to spaces #
            $value2 =~ s/±/\+/g;      # RE-convert ± signs BACK to + #
            #$value2 =~ s/(\r)+/\-\-/g;
            #$value2 =~ s/\n+//g;
            $value2 =~ s/:/ /g;   ## NEED TO KEEP - THIS BIG BUG FIX...

            push (@formdata,$name);
            push (@formdata,$value);
            push (@formdata2,$name);
            push (@formdata2,$value2);
            push (@form,$nameform);
            push (@form,$valueform);
            push (@formname,$name);
            push (@formvalue,$value);
            push (@formvalue2,$value2);


      }
      %formname=@formname;
      %formname;
      %formdvalue2=@formvalue2;
      %formvalue2;
      %formvalue=@formvalue;
      %formvalue;
      %formdata=@formdata;
      %formdata;
      %formdata2=@formdata2;
      %formdata2;


      }


sub main {

## NEW OK URL FUNCTIONALITY ##


                     if ($setokurl eq "1") {

  $referer = "\L$ENV{'HTTP_REFERER'}\E";
  $url = "0";

  foreach $myokurls (@okurls) {
  $myokurls = "\L$myokurls\E";

  $URL_length = length($myokurls); ## GET THE URL LENGTH #
  $LAST_okurl=$URL_length-1; ## FIND THE LAST CHARACHTER BEGINING NUMBER #
  $CHECK_trailing = substr($myokurls, $LAST_okurl, $URL_length); ## GET LAST CHARACHTER #

      ## CHECK IF TRAILING SLASH, IF NOT ADD ##
      if ($CHECK_trailing eq "/") {}else{
      $myokurls = "$myokurls/";
      $URL_length++;
      }

  ## GET ONLY THE BEGINING OF THE REFERER -- MUST EXACTLY MATCH!!! ##
  $CHECK_referer = substr($referer, 0, $URL_length);

      if ($CHECK_referer eq "$myokurls") {
      $url = "1";
      }

  } ## END FOREACH ##
  if ( $url eq "0") {
      print "Content-type: text/html\n\n";
      print "<BR><BR><font size=\"+1\"><center>BAD HTTP REFERER</center> <br><br>";
      exit;
  }


      ## added securit if removed HTTP REFERER - PREVENTS HACKING ##
      if (! $ENV{'HTTP_REFERER'})  {
      print "Content-type: text/html\n\n";
      print "<BR><BR><font size=\"+1\"><center>Security ISSUE! NO REFERER POSTED, SCRIPT NOT EXECUTED! </center> <br><br>";
      exit;
      }


                     } ## end SETOK URLS ##

## END NEW OK URL FUNCTIONALITY ##



$att_path = "$att_path$attachment_nm";


if (! $formdata{'error_page'}) {
$USE_error_page=$HTML_error_page{"1"};
}else{
$USE_error_page=$HTML_error_page{"$formdata{'error_page'}"};
}


    @sortfields = split(/,/,$formdata{'sort'});
    @required = split(/,/,$formdata{'required'});
    @required_desc = split(/,/,$formdata{'required_desc'});
    @required_stealth = split(/,/,$formdata{'required_stealth'});

for ($indexreq = 0; $indexreq < @required; $indexreq++) {
$myrequired = $required[$indexreq];
$myformreq = $formdata{"$myrequired"};


  if (!$myformreq){

if ($use_html_error eq "1") {
      require "$ABSOLUTE_PATH_TO_CGI_BIN$CGI_required";
      &REQ_format_error;
}else{
      require "$ABSOLUTE_PATH_TO_CGI_BIN$CGI_error";
      &format_error;
}

  } ## END missing REQUIRED ##
  elsif ($myrequired eq "email"){
      if (!$myformreq || $myformreq =~ /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/ || $myformreq !~ /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z0-9]+)(\]?)$/){

            if ($use_html_error eq "1") {
                  require "$ABSOLUTE_PATH_TO_CGI_BIN$CGI_required";
                  &REQ_format_error;
            }else{
                  require "$ABSOLUTE_PATH_TO_CGI_BIN$CGI_error";
                  &missing_email;
            }
      }
  } ## END IF REQUIRED IS EMAIL ##





}


if ($formdata{'sendreply'} eq "1"){
      if (!$formdata{'email'} || $formdata{'email'} =~ /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/ || $formdata{'email'} !~ /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z0-9]+)(\]?)$/){

if ($use_html_error eq "1") {
      require "$ABSOLUTE_PATH_TO_CGI_BIN$CGI_required";
      &REQ_missing_email;
}else{
      require "$ABSOLUTE_PATH_TO_CGI_BIN$CGI_error";
      &missing_email;
}

      } ## END IF ##
}


## CHECK TO SEE IF WRITE TO DATA FILE. ##

if ($send_data_results eq "1"){

if ($formdata{'datafile'}) {
$FORM_datafile = "$formdata{'datafile'}";
        $ctrfile=$datafile{"$FORM_datafile"};

}else{
        $ctrfile=$datafile{"1"};

}



     if ($formdata{'data_format'}){
     ${'seperatedby'} = "$formdata{'data_format'}";
     }else{
     ${'seperatedby'} = ",";
     }

     if ($formdata{'text_qualifier'} =~ 1){
     ${'spqualifier'} = '"';
     }



## START CHECK DUPLICATE ##

  if ($delete_dups eq "1"){

      open ( DUPFILE, "$ctrfile");
      @filelines=<DUPFILE>;
      close( DUPFILE );

        $linectr = "@filelines";

           if ($linectr =~ $formdata{'email'}){
                           &duplicate_email;
           }

  }



                        if ($formdata{'outputfile'}) { ##start if output##


    @outputfile = split(/,/,$formdata{'outputfile'});

         open(OUT,">> $ctrfile");
            eval "flock OUT,2";


for ($indexoutput = 0; $indexoutput < @outputfile; $indexoutput++) { ##start for each select output##
$myoutput = $outputfile[$indexoutput];
$myformoutput = $formdata2{"$myoutput"};

    if ($myoutput eq "ipaddress"){ ## if ipaddress  ##
       print OUT "${'spqualifier'}$ENV{'REMOTE_ADDR'}${'spqualifier'}${'seperatedby'}";
    }
    elsif ($myoutput eq "date"){ ## if date  ##
       print OUT "${'spqualifier'}$monthnamenum/$dayofmonth/$year at $newhour:$newmin${'spqualifier'}${'seperatedby'}";
    }else{
    print OUT "${'spqualifier'}$myformoutput${'spqualifier'}${'seperatedby'}";
    } ## end else  ##




} ##end for each ##

       print OUT "\n";
      close (OUT);




                          }else{ ## end if output / start else ouput##

         open(OUT,">> $ctrfile");
            eval "flock OUT,2";


for ($indexval = 0; $indexval < @formvalue; $indexval++) { ##start for ouput##
${'myname'} = $formname[$indexval];
${'myvalue'} = $formvalue2[$indexval];

## Check if config field ##
if (${'myname'} eq "reply_subject"|| ${'myname'} eq "subject" || ${'myname'} eq "sendreply" || ${'myname'} eq "required" || ${'myname'} eq "success_page" || ${'myname'} eq "message_format" || ${'myname'} eq "text_qualifier" || ${'myname'} eq "datafile" || ${'myname'} eq "outputfile" || ${'myname'} eq "data_format" || ${'myname'} eq "cc_to" || ${'myname'} eq "send_to" || ${'myname'} eq "plain_mesfile" || ${'myname'} eq "html_mesfile" || ${'myname'} eq "error_page" || ${'myname'} eq "required_desc"){
$dontrun = "1";
}else{
$dontrun = "";
}

                        if (! $dontrun){
                  print OUT "${'spqualifier'}${'myvalue'}${'spqualifier'}${'seperatedby'}";
                        }


      } ##end for ouput##

                  print OUT "${'spqualifier'}$ENV{'REMOTE_ADDR'}${'spqualifier'}${'seperatedby'}${'spqualifier'}$monthnamenum/$dayofmonth/$year at $newhour:$newmin${'spqualifier'}\n";

      close (OUT);

                                 
                           } ##end else output##



} ## END IF SEND RESULTS TO DATA FILE ##



for ($indexval = 0; $indexval < @formvalue; $indexval++) {
${'myname'} = $formname[$indexval];
$myname = $formname[$indexval];
${'myvalue'} = $formvalue[$indexval];

    $formdata{'reply_subject'} =~s/{$myname}/${'myvalue'}/g;

}


for ($indexval = 0; $indexval < @formvalue; $indexval++) {
${'myname'} = $formname[$indexval];
$myname = $formname[$indexval];
${'myvalue'} = $formvalue[$indexval];

    $formdata{'subject'} =~s/{$myname}/${'myvalue'}/g;

}


for ($indexval = 0; $indexval < @formvalue; $indexval++) {
${'myname'} = $formname[$indexval];
$myname = $formname[$indexval];
${'myvalue'} = $formvalue[$indexval];

    $formdata{'success_page'} =~s/{$myname}/${'myvalue'}/g;

}

     ## MUST INCLUDE THE SENDTO ON THE FORM... ##
     if ($formdata{'send_to'}) {
     &notify;
     }

         if ($formdata{'success_page'}) {
         print "Location: $formdata{'success_page'}\n\n";
         exit;
         }else{
         require "$ABSOLUTE_PATH_TO_CGI_BIN$CGI_error";
         &success;
         }



}


sub notify{

$FORM_sendto = "$formdata{'send_to'}";
$FORM_ccto = "$formdata{'cc_to'}";
$FINAL_sendto = $sendto{"$FORM_sendto"};
$FINAL_ccto = $cc_to{"$FORM_ccto"};


                 if ($formdata{'send_to'}){
                 $mail_sendto = "\"$reply_from_name\" <$FINAL_sendto>";
                 $MAIN_mail_send = "$FINAL_sendto";
                 }

                 if ($formdata{'cc_to'}){
                 $mail_ccto = "$FINAL_ccto";
                 }

        $HTML_format = "text/html";
        $PLAIN_format = "text/plain";



if ($formdata{'html_mesfile'}) {
      $USE_html_mf=$formdata{'html_mesfile'};
      $GET_html_mf=$HTML_mes_file{"$USE_html_mf"};
      $mime_html_body = &LoadFile("$GET_html_mf");
}else{
$mime_html_body = &LoadFile("html.mes");
}

if ($formdata{'plain_mesfile'}) {
      $USE_text_mf=$formdata{'plain_mesfile'};
      $GET_text_mf=$PLAIN_mes_file{"$USE_text_mf"};
      $mime_plain_body = &LoadFile("$GET_text_mf");
}else{
$mime_plain_body = &LoadFile("plain.mes");
}

        $reply_subject = $formdata{'reply_subject'};


if ($formdata{'message_format'} eq "html") {

$email_format = "$HTML_format";
$mime_body = "$mime_html_body";


}else{

$email_format = "$PLAIN_format";
$mime_body = "$mime_plain_body";

}



### CHECKS SEND TYPE ###

      if ($useLib eq "sendmail") {
        require "$ABSOLUTE_PATH_TO_CGI_BIN$CGI_sendmail";
        &sdsmail;
        }else{
        require "$ABSOLUTE_PATH_TO_CGI_BIN$CGI_smtp";
        &sdsmtp;
        }

}


sub duplicate_email {

      if ($formdata{'success_page'}){
      print "Location: $formdata{'success_page'}\n\n";
      exit;
      }else{
      require "$ABSOLUTE_PATH_TO_CGI_BIN$CGI_error";
      &success;
      }

}


sub LoadFile {
    my($filename) = @_;
##    my($result);##

    if (! -e $filename) {
        return $result;
    } # if

    open(FILE, "<$filename");
    my(@lines) = <FILE>;
    close FILE;

    my($line);
    foreach $line (@lines) {
        $result = $result . $line;
    } # foreach




for ($indexval = 0; $indexval < @formvalue; $indexval++) {
${'myname'} = $formname[$indexval];
$myname = $formname[$indexval];
${'myvalue'} = $formvalue[$indexval];

    $result =~s/{$myname}/${'myvalue'}/g;

}

    $PERSONAL_time = "$newhour:$newmin";
    $PERSONAL_date = "$monthnameactual/$dayofmonth/$year";

    $result =~s/{%DATE%}/$PERSONAL_date/g;
    $result =~s/{%TIME%}/$PERSONAL_time/g;
    $result =~s/{%TOD%}/$nightday/g;
    $result =~s/{%IP%}/$ENV{'REMOTE_ADDR'}/g;



    return $result;
}



=================================
Inquiry.html   This is the form html page
=================================





<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<meta name="generator" content="Adobe GoLive 6">
<title>Inquiry</title>
<link href="wforms.css" rel="stylesheet" type="text/css" />
<link href="wforms-jsonly.css" rel="alternate stylesheet" type="text/css" title="stylesheet activated by javascript" />
<script type="text/javascript" src="wforms.js" ></script>
</head>
<body bgcolor="#ffffff">
<?xml version="1.0" encoding="UTF-8"?>
<form method="post" action="/CGI-BIN/bizmail.cgi" name="Inquiry" id="Inquiry">
  <fieldset id="Inquiry" class="">
  <legend>Inquiry</legend>
  <div class="instructions">We only require your Email address to respond.</div>
  <span class="oneField">
  <label for="Name" class="preField">Name</label>
  <br>
  <input type="text" id="Name" name="Name" value="" size="" class=""/>
  <br/>
  </span> <span class="oneField">
  <label for="EmailAddress" class="preField">Email Address</label>
  <br>
   <input type="text" name="email" value="">
  <br/>
  </span> <span class="oneField">
  <label for="Phone" class="preField">Phone #</label>
  <br>
  <input type="text" id="Phone" name="Phone" value="" size="" class=""/>
  <br/>
  </span><span class="oneField">
  <label for="Address" class="preField">Address</label>
  <br>
  <input type="text" id="Address" name="Address" value="" size="" class=""/>
  <br/>
  </span><span class="oneField">
  <label for="City" class="preField">City</label>
  <br>
  <input type="text" id="City" name="City" value="" size="" class=""/>
  <br/>
  </span><span class="oneField">
  <label for="State" class="preField">State</label>
  <br>
  <select id="State" name="State" class="">
    <option value="Pleaseselect" selected="selected">Please select</option>
    <option value="Alabama">Alabama</option>
    <option value="Alaska">Alaska</option>
    <option value="Arizona">Arizona</option>
    <option value="Arkansas">Arkansas</option>
    <option value="California">California</option>
    <option value="Colorado">Colorado</option>
    <option value="Connecticut">Connecticut</option>
    <option value="Delaware">Delaware</option>
    <option value="DistrictOfColumbi">District Of Columbia</option>
    <option value="Florida">Florida</option>
    <option value="Georgia">Georgia</option>
    <option value="Hawaii">Hawaii</option>
    <option value="Idaho">Idaho</option>
    <option value="Illinois">Illinois</option>
    <option value="Indiana">Indiana</option>
    <option value="Iowa">Iowa</option>
    <option value="Kansas">Kansas</option>
    <option value="Kentucky">Kentucky</option>
    <option value="Louisiana">Louisiana</option>
    <option value="Maine">Maine</option>
    <option value="Maryland">Maryland</option>
    <option value="Massachusetts">Massachusetts</option>
    <option value="Michigan">Michigan</option>
    <option value="Minnesota">Minnesota</option>
    <option value="Mississippi">Mississippi</option>
    <option value="Missouri">Missouri</option>
    <option value="Montana">Montana</option>
    <option value="Nebraska">Nebraska</option>
    <option value="Nevada">Nevada</option>
    <option value="NewHampshire">New Hampshire</option>
    <option value="NewJersey">New Jersey</option>
    <option value="NewMexico">New Mexico</option>
    <option value="NewYork">New York</option>
    <option value="NorthCarolina">North Carolina</option>
    <option value="NorthDakota">North Dakota</option>
    <option value="Ohio">Ohio</option>
    <option value="Oklahoma">Oklahoma</option>
    <option value="Oregon">Oregon</option>
    <option value="Pennsylvania">Pennsylvania</option>
    <option value="RhodeIsland">Rhode Island</option>
    <option value="SouthCarolina">South Carolina</option>
    <option value="SouthDakota">South Dakota</option>
    <option value="Tennessee">Tennessee</option>
    <option value="Texas">Texas</option>
    <option value="Utah">Utah</option>
    <option value="Vermont">Vermont</option>
    <option value="Virginia">Virginia</option>
    <option value="Washington">Washington</option>
    <option value="WestVirginia">West Virginia</option>
    <option value="Wisconsin">Wisconsin</option>
    <option value="Wyoming">Wyoming</option>
    <option value="PuertoRico">Puerto Rico</option>
    <option value="VirginIsland">Virgin Island</option>
    <option value="NorthernMarianaIs">Northern Mariana Islands</option>
    <option value="Guam">Guam</option>
    <option value="AmericanSamoa">American Samoa</option>
    <option value="Palau">Palau</option>
  </select>
  <br>
  </span><span class="oneField">
  <label for="ZipCode" class="preField">Zip Code</label>
  <br>
  <input type="text" id="ZipCode" name="ZipCode" value="" size="" class="size"/>
  <br/>
  </span> <span class="oneField"> <span class="oneChoice">
  <input type="checkbox" value="yes" id="Putmeonyourpostal" name="Putmeonyourpostal"/>
  <label for="Putmeonyourpostal" id="Putmeonyourpostal-L" class="postField">Put me on your postal mailing list<br />
  </label>
  </span> <br/>
  </span> <span class="oneField">
  <label for="Howdidyouhearabou" class="preField">How did you hear about us?</label>
  <br>
  <select id="Howdidyouhearabou" name="Howdidyouhearabou" class="">
    <option value="Friend">Friend</option>
    <option value="Wordofmouth">Word of mouth</option>
    <option value="Google">Google</option>
    <option value="Yahoo">Yahoo</option>
    <option value="Msn">Msn</option>
    <option value="Magazine">Magazine</option>
    <option value="Newspaper">Newspaper</option>
    <option value="TradeShow">Trade Show</option>
  </select>
  <br/>
  </span> <span class="oneField">
  <label for="YourInquiry" class="preField">Your Inquiry</label>
  <br>
  <textarea id="YourInquiry" name="YourInquiry" class="" rows="8" cols="50"></textarea>
  <br/>
  <div class="actions">
  <input type="submit" class="primaryAction" id="submit-" value="submit"/>
  <input type="button" class="secondaryAction" value="cancel"/>
  </div>
  </span>
  </fieldset>
 
  <input type="hidden" name="send_to" value="1">
  <input type="hidden" name="cc_to" value="1">
  <input type="hidden" name="subject" value="Inquiry">
  <!-- <input type="hidden" name="sendreply" value="1">
  <input type="hidden" name="message_format" value="html">
  <input type="hidden" name="html_mesfile" value="1">
  <input type="hidden" name="reply_subject" value="RE: Your recent inquiry."> -->
 
</form>
</body>
</html>




Avatar of Perl_Diver
Perl_Diver

all of the email addresses, like this one for example:

 $cc_to{"1"} = "rckfd@charter.net";

need to be like this:

$cc_to{"1"} = "rckfd\@charter.net";

or like this:

$cc_to{"1"} = 'rckfd@charter.net';

just like it says in the instructions: ## (REMEMBER THE \ BEFORE THE @ SIGN)

the @ symbol means an array in perl. Inside of double-quotes perl thinks you want to convert the array @charter into a string, so you must escape it with a backslash so perl treats it like a literal @ symbol or use single-quotes to avoid variable interpolation.

Setting the smtp server to localhost might not be correct, check with your host what the smtp server should be set to.

Avatar of pmrussell892

ASKER

thanx perl driver,

Fixed the slash problem, and now i get the email to the send_to address and get the reply email with the from name and subject filled in but the reply email is blank. Also am still not getting the carbon copy to my other email address.

Reposted below is what I have now.

I dont know why the slashes where missing just then, But i was checking them very carefully.

=====================
bizmail.cgi
=====================

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

##########################################################################################
##  FILE: bizmail.cgi                                                                   ##
##                                                                                      ##
##  BizMailForm                                   Version 2.2.2                         ##
##  ©Copyright 2000-2005+ 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/                                  ##
##                                                                                      ##
##                                                                                      ##
##  ANY PERSON(S) MAY USE AND MODIFY THESE SCRIPT(S) FREE OF CHARGE FOR EITHER BUSINESS ##
##  OR PERSONAL, HOWEVER AT ALL TIMES HEADERS AND COPYRIGHT MUST ALWAYS REMAIN INTACT.  ##
##                                                                                      ##
##  REDISTRIBUTION FOR PROFIT IS PROHIBITED WITH OUT THE CONSENT OF SETH KNORR.         ##
##                                                                                      ##
##  By using this code you agree to indemnify Seth M. Knorr from any liability that     ##
##  might arise from its use.                                                           ##
##                                                                                      ##
##########################################################################################
##                                                                                      ##
##                       MIME Lite.pm copyright information below:                      ##
##                                                                                      ##
## Eryq (F<eryq@zeegee.com>).President, ZeeGee Software Inc. (F<http://www.zeegee.com>).##
##                                                                                      ##
##########################################################################################
##                                                                                      ##
##               T H A N K   Y O U   I N   A D V A N C E   F O R                        ##
##                 S U P P O R T I N G   M Y   S P O N S O R S                          ##
##                                                                                      ##
##########################################################################################


#----- 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 = "//fp/home/users/web/b260/ph.d30048914/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 = "smtp";

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

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


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

$smtp_server = "localhost";  ## $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 = "Kowalski Furniture Design";


#----- 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 = "2";

        $FROM_results_email = "rckfd\@charter.net";


#----- 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 to person filling out the   ##
## form.                                                                                ##


        $sendto{"1"} = "pmrussell892\@gmail.com";## (REMEMBER THE \ BEFORE THE @ SIGN)##
        $sendto{"2"} = "rckfd\@charter.net";



#----- 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"} = "pete\@hometowngeek.com";


#-----  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.kowalskifurnituredesign.com/", "http://kowalskifurnituredesign.com/", "https://kowalskifurnituredesign.com/", "https://www.kowalskifurnituredesign.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 = "2";

$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";

#----- 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 = "2";



#----- 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:                                            ##
## <input type="hidden" name="plain_mesfile" value="1">                                       ##
## 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";


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

## $HTML_mes_file{"1"} or $HTML_mes_file{"2"} ... Specify the file name of the HTML           ##
## Auto-Response email that will be sent if HTML is specified. The message is selected        ##
## by what is inserted into the hidden form field:                                            ##
## <input type="hidden" name="html_mesfile" value="1">                                        ##
## NOTE: If this field is not used in the form the default HTML file used is: html.mes        ##

        $HTML_mes_file{"1"} = "../CGI-BIN/html.mes";


#----- 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";


#----- D E L E T E   D U P S -----#

## $delete_dups = "1";  will delete all dups.    ##
## To leave duplicate posts set $delete_dups = "2"; (DEFAULT - MOST COMMON CHOICE)  ##
##  (A duplicate is determined by the email field.)  ##

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



#-----  F I L E   A T T A C H M E N T -----#

## $send_attachement specifys if you want to send an attachment with the auto response. ##
## Set $send_attachement = "1"; to send attachment with autoresponse                    ##
## Set $send_attachement = "2"; to not send attachment with autoresponse                ##

      $send_attachement = "2";

## IF USING A FILE ATTACHMENT YOU MUST CONFIGURE THE BELOW THREE VARIABLES              ##

$attachment_nm = "page.pdf";  ## file name of attachement ##

$att_path = "/path/to/attachment/";  ## Path to file attachement WITH TRAILING / ##

$att_format = ".pdf";  ## File attachement extension, or file type (basicaly .exstension ) ##


# $att_content_type IS THE CONTENT-TYPE OF THE ATTACHMENT #

      $att_content_type = "pdf"; # FORMAT FOR A "PDF" #

      # $att_content_type = "text/html";
      # $att_content_type = "image/gif"; # FORMAT FOR A "GIF IMAGE" #
      # $att_content_type = "image/jpeg"; # FORMAT FOR A "JPEG IMAGE" #
      # $att_content_type = "image/png"; # FORMAT FOR A "PNG IMAGE" #
      # $att_content_type = "zip"; # FORMAT FOR A "ZIP" #


#----- S E R V E R   T I M E   Z O N E   H O U R   O F F   S E T -----#

## USED IF YOUR SERVER TIME IS FAST OR SLOW.  ##

## TO NOT USE THIS FEATURE SET $HOUR_offset = "0"; (DEFAULT) ##
## ENTER + OR - THE AMOUNT OF HOURS TO OFFSET YOUR SERVERS HOUR BY ##

$HOUR_offset = "0";

      ## EXAMPLES:
      ## $HOUR_offset = "+1";
      ## $HOUR_offset = "-1";



###########################################################################
####                                                                    ###
####   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     ###
####                                                                    ###
###########################################################################


$CGI_error = "error.cgi";
$CGI_required = "required.cgi";
$CGI_smtp = "smtp.cgi";
$CGI_sendmail = "sendmail.cgi";



$versionnumber = "Version 2.2.2";
$footer = "You can close this window";

   $offset = @_;
    $offset=$offset*86400;

    ($sec, $min, $hour, $dayofmonth, $mon, $year, $weekday, $dayofyear, $IsDST) = localtime(time + $offset);
    $year = $year + 1900;
    @months = ("JA", "FB", "MR", "AP", "MY", "JN", "JL", "AG", "SP", "Oc", "NV", "DE");
    $monthname = $months[$mon];
    @monthsnum = ("1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12");
    $monthnamenum = $monthsnum[$mon];

    @monthsactual = ("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
    $monthnameactual = $monthsactual[$mon];


    @days = ("Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday");
    $dayname = $days[$weekday-1];

${'monthname'} = "$monthname";
${'monthnamenum'} = "$monthnamenum";
${'dayofmonth'} = "$dayofmonth";


$month = "$monthnamenum";


## CALCULATE IF IT IS A LEAP YEAR ##

     if (isleap((localtime(time))[5])) {
     $IS_leapyear = "1";
     }else{
     $IS_leapyear = "";
     }


     sub isleap     {
          my ($year) = @_;
          $year += 1900;
          return 1 if ( ($year % 4 == 0) &&
               ( ($year % 100) || ($year % 400 == 0) ) );
          return 0;
     }

## END CALCULATE IF IT IS A LEAP YEAR ##


if ($IS_leapyear) {
$FEB_days = "29";
}else{
$FEB_days = "28";
}

@NUM_month_days = ("0", "31", "$FEB_days", "31", "30", "31", "30", "31", "31", "30", "31", "30", "31");

$month++;
$month--;


if (! $HOUR_offset || $HOUR_offset eq "0"){}else{

$hour=$hour+24;
$hour=$hour+$HOUR_offset;

      if ($hour < "24") {
            if ($day eq "$NUM_month_days[$month]") {
                  if ($month < "12") {
                  $month--;
                  }else{
                  $month = "1";
                  $year++;
                  }
            $day--;
            }else{
            $day--;
            }
      }
      elsif ($hour > "24") {
            if ($day eq "1") {
                  if ($month == "1") {
                  $month = "12";
                  $year--;
                  }else{
                  $month--;
                  }
            $day=$day+$NUM_month_days[$month]; ## ADD NEXT MONTHS DAYS TO HERE ##
            }
      $day--;  ## SUBTRACT ONE DAY
      $hour=$hour-24;
      }else{
      $hour=$hour-24;
      }
}

      if ($hour eq "12"){
      $newhour = "$hour";
      $nightday = "PM";
      }
      elsif ($hour > 12){
      $newhour = ($hour-12);
      $nightday = "PM";
      }else{
      $newhour=$hour;
      $nightday = "AM";
      }

$hourplus="$newhour";
${'hour'}=$newhour;

if ($min <= 9){
$newmin = "0$min";
}else{
$newmin = "$min";
}


if($ENV{'REQUEST_METHOD'} eq "GET" || ! $ENV{'REQUEST_METHOD'}) {
require "$ABSOLUTE_PATH_TO_CGI_BIN$CGI_error";
&nopost;
}
elsif($ENV{'REQUEST_METHOD'} eq "POST") {
&get_form_data;
&main;
}else{

print "Content-type: text/html\n\n";
print "<font size=\"+1\"><center>Your server is MIS-CONFIGURED, and is not running the tag <b>\$ENV{'REQUEST_METHOD'}</b> properly <br><br>";
print "Please check with your Host or Systems Administrator to fix this problem.</font></center>";
exit;
}


sub get_form_data {

      read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
      $buffer =~ s/\%2B/±/g;  ## CONVERT + SIGNS TO ± TO BE LATTER CONVERTED BACK ##
      @pairs=split(/&/,$buffer);
      foreach $pair (@pairs)
      {
            @a = split(/=/,$pair);
            $name=$a[0];
            $value=$a[1];
            $value2=$a[1];
            $name =~ s/\+/ /g;
            $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
            $value =~ s/~!/ ~!/g;
            $value =~ s/\+/ /g;
            $value =~ s/(\r)+/\-\-/g;
            $value =~ s/\n+//g;
            $value =~ s/(\-\-)+/\n/g;
                $value =~ s|<|\&lt\;|g;       # convert all '<' to "&lt\;"
                $value =~ s|>|\&gt\;|g;              # convert all '>' to "&gt\;"

            $value =~ s/\+/ /g;      # convert + signs to spaces #
            $value =~ s/±/\+/g;      # RE-convert ± signs BACK to + #

## $value2 is used in variables of data sent to the data file##
            $value2 =~ s/(\")+/``/g; #V1.5 Bug Fix - Converts " to `` in data file #
            $value2 =~ s/(')+/`/g; #V1.8 Bug Fix - Converts ' to ` in data file #
            $value2 =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
                $value2 =~ s|\n|<br>\n|g;      # convert all line feeds to "<br>" and line feed  #
            #$value2 =~ s/~!/ ~!/g;
            $value2 =~ s/\+/ /g;      # convert + signs to spaces #
            $value2 =~ s/±/\+/g;      # RE-convert ± signs BACK to + #
            #$value2 =~ s/(\r)+/\-\-/g;
            #$value2 =~ s/\n+//g;
            $value2 =~ s/:/ /g;   ## NEED TO KEEP - THIS BIG BUG FIX...

            push (@formdata,$name);
            push (@formdata,$value);
            push (@formdata2,$name);
            push (@formdata2,$value2);
            push (@form,$nameform);
            push (@form,$valueform);
            push (@formname,$name);
            push (@formvalue,$value);
            push (@formvalue2,$value2);


      }
      %formname=@formname;
      %formname;
      %formdvalue2=@formvalue2;
      %formvalue2;
      %formvalue=@formvalue;
      %formvalue;
      %formdata=@formdata;
      %formdata;
      %formdata2=@formdata2;
      %formdata2;


      }


sub main {

## NEW OK URL FUNCTIONALITY ##


                     if ($setokurl eq "1") {

  $referer = "\L$ENV{'HTTP_REFERER'}\E";
  $url = "0";

  foreach $myokurls (@okurls) {
  $myokurls = "\L$myokurls\E";

  $URL_length = length($myokurls); ## GET THE URL LENGTH #
  $LAST_okurl=$URL_length-1; ## FIND THE LAST CHARACHTER BEGINING NUMBER #
  $CHECK_trailing = substr($myokurls, $LAST_okurl, $URL_length); ## GET LAST CHARACHTER #

      ## CHECK IF TRAILING SLASH, IF NOT ADD ##
      if ($CHECK_trailing eq "/") {}else{
      $myokurls = "$myokurls/";
      $URL_length++;
      }

  ## GET ONLY THE BEGINING OF THE REFERER -- MUST EXACTLY MATCH!!! ##
  $CHECK_referer = substr($referer, 0, $URL_length);

      if ($CHECK_referer eq "$myokurls") {
      $url = "1";
      }

  } ## END FOREACH ##
  if ( $url eq "0") {
      print "Content-type: text/html\n\n";
      print "<BR><BR><font size=\"+1\"><center>BAD HTTP REFERER</center> <br><br>";
      exit;
  }


      ## added securit if removed HTTP REFERER - PREVENTS HACKING ##
      if (! $ENV{'HTTP_REFERER'})  {
      print "Content-type: text/html\n\n";
      print "<BR><BR><font size=\"+1\"><center>Security ISSUE! NO REFERER POSTED, SCRIPT NOT EXECUTED! </center> <br><br>";
      exit;
      }


                     } ## end SETOK URLS ##

## END NEW OK URL FUNCTIONALITY ##



$att_path = "$att_path$attachment_nm";


if (! $formdata{'error_page'}) {
$USE_error_page=$HTML_error_page{"1"};
}else{
$USE_error_page=$HTML_error_page{"$formdata{'error_page'}"};
}


    @sortfields = split(/,/,$formdata{'sort'});
    @required = split(/,/,$formdata{'required'});
    @required_desc = split(/,/,$formdata{'required_desc'});
    @required_stealth = split(/,/,$formdata{'required_stealth'});

for ($indexreq = 0; $indexreq < @required; $indexreq++) {
$myrequired = $required[$indexreq];
$myformreq = $formdata{"$myrequired"};


  if (!$myformreq){

if ($use_html_error eq "1") {
      require "$ABSOLUTE_PATH_TO_CGI_BIN$CGI_required";
      &REQ_format_error;
}else{
      require "$ABSOLUTE_PATH_TO_CGI_BIN$CGI_error";
      &format_error;
}

  } ## END missing REQUIRED ##
  elsif ($myrequired eq "email"){
      if (!$myformreq || $myformreq =~ /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/ || $myformreq !~ /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z0-9]+)(\]?)$/){

            if ($use_html_error eq "1") {
                  require "$ABSOLUTE_PATH_TO_CGI_BIN$CGI_required";
                  &REQ_format_error;
            }else{
                  require "$ABSOLUTE_PATH_TO_CGI_BIN$CGI_error";
                  &missing_email;
            }
      }
  } ## END IF REQUIRED IS EMAIL ##





}


if ($formdata{'sendreply'} eq "1"){
      if (!$formdata{'email'} || $formdata{'email'} =~ /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/ || $formdata{'email'} !~ /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z0-9]+)(\]?)$/){

if ($use_html_error eq "1") {
      require "$ABSOLUTE_PATH_TO_CGI_BIN$CGI_required";
      &REQ_missing_email;
}else{
      require "$ABSOLUTE_PATH_TO_CGI_BIN$CGI_error";
      &missing_email;
}

      } ## END IF ##
}


## CHECK TO SEE IF WRITE TO DATA FILE. ##

if ($send_data_results eq "1"){

if ($formdata{'datafile'}) {
$FORM_datafile = "$formdata{'datafile'}";
        $ctrfile=$datafile{"$FORM_datafile"};

}else{
        $ctrfile=$datafile{"1"};

}



     if ($formdata{'data_format'}){
     ${'seperatedby'} = "$formdata{'data_format'}";
     }else{
     ${'seperatedby'} = ",";
     }

     if ($formdata{'text_qualifier'} =~ 1){
     ${'spqualifier'} = '"';
     }



## START CHECK DUPLICATE ##

  if ($delete_dups eq "1"){

      open ( DUPFILE, "$ctrfile");
      @filelines=<DUPFILE>;
      close( DUPFILE );

        $linectr = "@filelines";

           if ($linectr =~ $formdata{'email'}){
                           &duplicate_email;
           }

  }



                        if ($formdata{'outputfile'}) { ##start if output##


    @outputfile = split(/,/,$formdata{'outputfile'});

         open(OUT,">> $ctrfile");
            eval "flock OUT,2";


for ($indexoutput = 0; $indexoutput < @outputfile; $indexoutput++) { ##start for each select output##
$myoutput = $outputfile[$indexoutput];
$myformoutput = $formdata2{"$myoutput"};

    if ($myoutput eq "ipaddress"){ ## if ipaddress  ##
       print OUT "${'spqualifier'}$ENV{'REMOTE_ADDR'}${'spqualifier'}${'seperatedby'}";
    }
    elsif ($myoutput eq "date"){ ## if date  ##
       print OUT "${'spqualifier'}$monthnamenum/$dayofmonth/$year at $newhour:$newmin${'spqualifier'}${'seperatedby'}";
    }else{
    print OUT "${'spqualifier'}$myformoutput${'spqualifier'}${'seperatedby'}";
    } ## end else  ##




} ##end for each ##

       print OUT "\n";
      close (OUT);




                          }else{ ## end if output / start else ouput##

         open(OUT,">> $ctrfile");
            eval "flock OUT,2";


for ($indexval = 0; $indexval < @formvalue; $indexval++) { ##start for ouput##
${'myname'} = $formname[$indexval];
${'myvalue'} = $formvalue2[$indexval];

## Check if config field ##
if (${'myname'} eq "reply_subject"|| ${'myname'} eq "subject" || ${'myname'} eq "sendreply" || ${'myname'} eq "required" || ${'myname'} eq "success_page" || ${'myname'} eq "message_format" || ${'myname'} eq "text_qualifier" || ${'myname'} eq "datafile" || ${'myname'} eq "outputfile" || ${'myname'} eq "data_format" || ${'myname'} eq "cc_to" || ${'myname'} eq "send_to" || ${'myname'} eq "plain_mesfile" || ${'myname'} eq "html_mesfile" || ${'myname'} eq "error_page" || ${'myname'} eq "required_desc"){
$dontrun = "1";
}else{
$dontrun = "";
}

                        if (! $dontrun){
                  print OUT "${'spqualifier'}${'myvalue'}${'spqualifier'}${'seperatedby'}";
                        }


      } ##end for ouput##

                  print OUT "${'spqualifier'}$ENV{'REMOTE_ADDR'}${'spqualifier'}${'seperatedby'}${'spqualifier'}$monthnamenum/$dayofmonth/$year at $newhour:$newmin${'spqualifier'}\n";

      close (OUT);

                                 
                           } ##end else output##



} ## END IF SEND RESULTS TO DATA FILE ##



for ($indexval = 0; $indexval < @formvalue; $indexval++) {
${'myname'} = $formname[$indexval];
$myname = $formname[$indexval];
${'myvalue'} = $formvalue[$indexval];

    $formdata{'reply_subject'} =~s/{$myname}/${'myvalue'}/g;

}


for ($indexval = 0; $indexval < @formvalue; $indexval++) {
${'myname'} = $formname[$indexval];
$myname = $formname[$indexval];
${'myvalue'} = $formvalue[$indexval];

    $formdata{'subject'} =~s/{$myname}/${'myvalue'}/g;

}


for ($indexval = 0; $indexval < @formvalue; $indexval++) {
${'myname'} = $formname[$indexval];
$myname = $formname[$indexval];
${'myvalue'} = $formvalue[$indexval];

    $formdata{'success_page'} =~s/{$myname}/${'myvalue'}/g;

}

     ## MUST INCLUDE THE SENDTO ON THE FORM... ##
     if ($formdata{'send_to'}) {
     &notify;
     }

         if ($formdata{'success_page'}) {
         print "Location: $formdata{'success_page'}\n\n";
         exit;
         }else{
         require "$ABSOLUTE_PATH_TO_CGI_BIN$CGI_error";
         &success;
         }



}


sub notify{

$FORM_sendto = "$formdata{'send_to'}";
$FORM_ccto = "$formdata{'cc_to'}";
$FINAL_sendto = $sendto{"$FORM_sendto"};
$FINAL_ccto = $cc_to{"$FORM_ccto"};


                 if ($formdata{'send_to'}){
                 $mail_sendto = "\"$reply_from_name\" <$FINAL_sendto>";
                 $MAIN_mail_send = "$FINAL_sendto";
                 }

                 if ($formdata{'cc_to'}){
                 $mail_ccto = "$FINAL_ccto";
                 }

        $HTML_format = "text/html";
        $PLAIN_format = "text/plain";



if ($formdata{'html_mesfile'}) {
      $USE_html_mf=$formdata{'html_mesfile'};
      $GET_html_mf=$HTML_mes_file{"$USE_html_mf"};
      $mime_html_body = &LoadFile("$GET_html_mf");
}else{
$mime_html_body = &LoadFile("html.mes");
}

if ($formdata{'plain_mesfile'}) {
      $USE_text_mf=$formdata{'plain_mesfile'};
      $GET_text_mf=$PLAIN_mes_file{"$USE_text_mf"};
      $mime_plain_body = &LoadFile("$GET_text_mf");
}else{
$mime_plain_body = &LoadFile("plain.mes");
}

        $reply_subject = $formdata{'reply_subject'};


if ($formdata{'message_format'} eq "html") {

$email_format = "$HTML_format";
$mime_body = "$mime_html_body";


}else{

$email_format = "$PLAIN_format";
$mime_body = "$mime_plain_body";

}



### CHECKS SEND TYPE ###

      if ($useLib eq "sendmail") {
        require "$ABSOLUTE_PATH_TO_CGI_BIN$CGI_sendmail";
        &sdsmail;
        }else{
        require "$ABSOLUTE_PATH_TO_CGI_BIN$CGI_smtp";
        &sdsmtp;
        }

}


sub duplicate_email {

      if ($formdata{'success_page'}){
      print "Location: $formdata{'success_page'}\n\n";
      exit;
      }else{
      require "$ABSOLUTE_PATH_TO_CGI_BIN$CGI_error";
      &success;
      }

}


sub LoadFile {
    my($filename) = @_;
##    my($result);##

    if (! -e $filename) {
        return $result;
    } # if

    open(FILE, "<$filename");
    my(@lines) = <FILE>;
    close FILE;

    my($line);
    foreach $line (@lines) {
        $result = $result . $line;
    } # foreach




for ($indexval = 0; $indexval < @formvalue; $indexval++) {
${'myname'} = $formname[$indexval];
$myname = $formname[$indexval];
${'myvalue'} = $formvalue[$indexval];

    $result =~s/{$myname}/${'myvalue'}/g;

}

    $PERSONAL_time = "$newhour:$newmin";
    $PERSONAL_date = "$monthnameactual/$dayofmonth/$year";

    $result =~s/{%DATE%}/$PERSONAL_date/g;
    $result =~s/{%TIME%}/$PERSONAL_time/g;
    $result =~s/{%TOD%}/$nightday/g;
    $result =~s/{%IP%}/$ENV{'REMOTE_ADDR'}/g;



    return $result;
}




=======================================
And the changes to the form. this is the quotes form
=======================================

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<meta name="generator" content="Adobe GoLive 6">
<title>Piece order form</title>
<link href="wforms.css" rel="stylesheet" type="text/css" />
<link href="wforms-jsonly.css" rel="alternate stylesheet" type="text/css" title="stylesheet activated by javascript" />
<script type="text/javascript" src="../wforms.js" ></script>
</head>
<body bgcolor="#ffffff">
<p>You will usually receive a <strong>quotation </strong>from us within 24 hours.
<p>Once we receive your <strong>order</strong> we will provide you with an order confirmation for your review.&nbsp; At  this time we will request a 50% deposit to get you into our currently  18 week shop scheduling.&nbsp; When your pieces go into our finishing room  we will request the balance due.&nbsp; Once we receive your balance due we  will schedule your delivery with our white glove delivery service. This  service takes 2-6 weeks depending on where your pieces are to be  delivered.</p>
<p>We welcome pickups at our shop in Spencer, Mass.&nbsp;  We will notify you a week or more before it is ready to pick up. You  will pay the balance due at time of pick up and we will need to collect  a 5% Massachusetts sales tax.</p>
<form method="post" action="../CGI-BIN/bizmail.cgi" name="Orders" id="Orders">
  <fieldset id="PersonalInformation" class="">
  <legend>Personal Information</legend>
  <div class="instructions"></div>
  <span class="oneField">
  <label for="RequestType" class="preField">This is a</label><br>
  <select id="RequestType" name="State" class="">
    <option value="Order" selected="selected">Order</option>
    <option value="Qoute">Quote</option>
  </select>
  <br>
  <br>
  </span>
  <span class="oneField">
  <label for="Name" class="preField">Name</label>
  <br>
  <input type="text" id="Name" name="Name" value="" size="" class=""/>
  <br/>
  </span> <span class="oneField">
  <label for="email" class="preField">Email Address</label>
  <br>
  <input type="text" name="email" value="">
  <br/>
  </span> <span class="oneField">
  <label for="Phone" class="preField">Phone #</label>
  <br>
  <input type="text" id="Phone" name="Phone" value="" size="" class=""/>
  <br/>
  </span> <span class="oneField">
  <label for="Address" class="preField">Address</label>
  <br>
  <input type="text" id="Address" name="Address" value="" size="" class=""/>
  <br/>
  </span><span class="oneField">
  <label for="City" class="preField">City</label>
  <br>
  <input type="text" id="City" name="City" value="" size="" class=""/>
  <br/>
  </span> <span class="oneField">
  <label for="State" class="preField">State</label>
  <br>
  <select id="State" name="State" class="">
    <option value="Pleaseselect" selected="selected">Please select</option>
    <option value="Alabama">Alabama</option>
    <option value="Alaska">Alaska</option>
    <option value="Arizona">Arizona</option>
    <option value="Arkansas">Arkansas</option>
    <option value="California">California</option>
    <option value="Colorado">Colorado</option>
    <option value="Connecticut">Connecticut</option>
    <option value="Delaware">Delaware</option>
    <option value="DistrictOfColumbi">District Of Columbia</option>
    <option value="Florida">Florida</option>
    <option value="Georgia">Georgia</option>
    <option value="Hawaii">Hawaii</option>
    <option value="Idaho">Idaho</option>
    <option value="Illinois">Illinois</option>
    <option value="Indiana">Indiana</option>
    <option value="Iowa">Iowa</option>
    <option value="Kansas">Kansas</option>
    <option value="Kentucky">Kentucky</option>
    <option value="Louisiana">Louisiana</option>
    <option value="Maine">Maine</option>
    <option value="Maryland">Maryland</option>
    <option value="Massachusetts">Massachusetts</option>
    <option value="Michigan">Michigan</option>
    <option value="Minnesota">Minnesota</option>
    <option value="Mississippi">Mississippi</option>
    <option value="Missouri">Missouri</option>
    <option value="Montana">Montana</option>
    <option value="Nebraska">Nebraska</option>
    <option value="Nevada">Nevada</option>
    <option value="NewHampshire">New Hampshire</option>
    <option value="NewJersey">New Jersey</option>
    <option value="NewMexico">New Mexico</option>
    <option value="NewYork">New York</option>
    <option value="NorthCarolina">North Carolina</option>
    <option value="NorthDakota">North Dakota</option>
    <option value="Ohio">Ohio</option>
    <option value="Oklahoma">Oklahoma</option>
    <option value="Oregon">Oregon</option>
    <option value="Pennsylvania">Pennsylvania</option>
    <option value="RhodeIsland">Rhode Island</option>
    <option value="SouthCarolina">South Carolina</option>
    <option value="SouthDakota">South Dakota</option>
    <option value="Tennessee">Tennessee</option>
    <option value="Texas">Texas</option>
    <option value="Utah">Utah</option>
    <option value="Vermont">Vermont</option>
    <option value="Virginia">Virginia</option>
    <option value="Washington">Washington</option>
    <option value="WestVirginia">West Virginia</option>
    <option value="Wisconsin">Wisconsin</option>
    <option value="Wyoming">Wyoming</option>
    <option value="PuertoRico">Puerto Rico</option>
    <option value="VirginIsland">Virgin Island</option>
    <option value="NorthernMarianaIs">Northern Mariana Islands</option>
    <option value="Guam">Guam</option>
    <option value="AmericanSamoa">American Samoa</option>
    <option value="Palau">Palau</option>
  </select>
  <br>
  </span> <span class="oneField">
  <label for="ZipCode" class="preField">Zip Code</label>
  <br>
  <input type="text" id="ZipCode" name="ZipCode" value="" size="" class="size"/>
  <br/>
  </span> <br/>
  </fieldset>
  <fieldset id="PieceInformation" class="">
  <legend>Piece Information</legend>
  <span class="oneField">
  <label for="PieceName" class="preField">Piece Name</label>
  <br>
  <input type="text" id="PieceName" name="PieceName" value="" size="" class=""/>
  <br/><br>
  </span><span class="oneField">
  <label for="HardwoodType" class="preField">Hardwood Type</label>
  <br>
  <select id="HardwoodType" name="HardwoodType" class="">
    <option value="Cherry">Cherry</option>
    <option value="Mahogany">Mahogany</option>
    <option value="Maple">Maple</option>
    <option value="Walnut">Walnut</option>
  </select>
  <br/>
  <br>
  </span><br>
  <div id="SizeinInches" class="inlineSection" align="left"><br>
    <label class="preField">Size in Inches </label>
    <br>
    <span>
    <label for="Wide" class="inlineLabel">Wide</label>
    <input type="text" id="Wide" name="Wide" value="" class="size"/>
    </span> <span>
    <label for="Deep" class="inlineLabel">Deep</label>
    <input type="text" id="Deep" name="Deep" value="" class="size"/>
    </span> <span>
    <label for="High" class="inlineLabel">High</label>
    <input type="text" id="High" name="High" value="" class="size"/>
    <br>
    <br>
    <label>Additional description or special requests</label>
    <br>
    <span>
    <textarea name="AdditionalComments" rows="13" cols="50" wrap="physical"></textarea>
    </span><br>
    </span> </div>
  </fieldset>
  <div class="actions" align="left"> </div>
  <div class="actions"> </div>
 <!-- <input type="hidden" name="my_email" value="pmrussell892@gmail.com">
  <input type="hidden" name="subject" value="Inquiry">
  <input type="hidden" name="thankyou_url" value="http://kowalskifurnituredesign.com/forms/success.html">
  <input type ="hidden" name ="bcc" value="pete@hometowngeek.com"> -->
  <input type="submit" class="primaryAction" id="submit-" value="submit"/>
  <input type="button" class="secondaryAction" value="cancel"/>
 
  <input type="hidden" name="send_to" value="1">
  <input type="hidden" name="cc_to" value="1">
  <input type="hidden" name="subject" value="Order-Quote">
  <input type="hidden" name="sendreply" value="1">
  <input type="hidden" name="message_format" value="plain">
  <input type="hidden" name="plain_mesfile" value="1">
  <input type="hidden" name="reply_subject" value="RE: Your recent inquiry.">
 
</form>
</body>
</html>


===========================
Also checked with the host and they said to use localhost as the smtp server address. I get the results email to the main email address only.
These lines appear to do nothing:

     %formname=@formname;
     %formname;
     %formdvalue2=@formvalue2;
     %formvalue2;
     %formvalue=@formvalue;
     %formvalue;
     %formdata=@formdata;
     %formdata;
     %formdata2=@formdata2;
     %formdata2;

or I should say they define a bunch of hashes with no values. And then there are many "used once" warnings:

Useless use of a variable in void context at script line 455.
Useless use of a variable in void context at script line 457.
Useless use of a variable in void context at script line 459.
Useless use of a variable in void context at script line 461.
Name "main::hourplus" used only once: possible typo at script line 380.
Name "main::FROM_results_email" used only once: possible typo at script line 87.
Name "main::dayofyear" used only once: possible typo at script line 279.
Name "main::required_stealth" used only once: possible typo at script line 534.
Name "main::footer" used only once: possible typo at script line 274.
Name "main::versionnumber" used only once: possible typo at script line 273.
Name "main::nameform" used only once: possible typo at script line 446.
Name "main::smtp_server" used only once: possible typo at script line 69.
Name "main::IsDST" used only once: possible typo at script line 279.
Name "main::dayname" used only once: possible typo at script line 291.
Name "main::mail_sendto" used only once: possible typo at script line 758.
Name "main::mail_ccto" used only once: possible typo at script line 763.
Name "main::att_format" used only once: possible typo at script line 230.
Name "main::reply_subject" used only once: possible typo at script line 787.
Name "main::mailprog" used only once: possible typo at script line 64.
Name "main::formdvalue2" used only once: possible typo at script line 456.
Name "main::send_attachement" used only once: possible typo at script line 222.
Name "main::send_email_results" used only once: possible typo at script line 203.
Name "main::att_content_type" used only once: possible typo at script line 235.
Name "main::required_desc" used only once: possible typo at script line 533.
Name "main::sortfields" used only once: possible typo at script line 531.
Name "main::MY_error_page" used only once: possible typo at script line 149.
Name "main::send_from_poster" used only once: possible typo at script line 85.
Name "main::MAIN_mail_send" used only once: possible typo at script line 759.
Name "main::sec" used only once: possible typo at script line 279.
Name "main::valueform" used only once: possible typo at script line 447.
Name "main::PRNT_blankfields" used only once: possible typo at script line 158.

there are more scripts or configuration files involved:

$CGI_error = "error.cgi";
$CGI_required = "required.cgi";
$CGI_smtp = "smtp.cgi";
$CGI_sendmail = "sendmail.cgi";

make sure the above files are configured properly if necessary.

 Post a link to a text copy of your script next time, posting a long script makes it very hard to read the thread.
the other cgi files say there is no need to edit them. I am not a cgi programmer so I have no idea what to change in those files.

Here are links to the files in txt format.

bizmail.cgi  http://kowalskifurnituredesign.com/cgi-bin/bizmail.cgi.txt
error.cgi     http://kowalskifurnituredesign.com/cgi-bin/error.cgi.txt
smtp.cgi     http://kowalskifurnituredesign.com/cgi-bin/smtp.cgi.txt
required.cgi  http://kowalskifurnituredesign.com/cgi-bin/smtp.cgi.txt

My forms in txt format

orders.html  http://kowalskifurnituredesign.com/forms/orders.html.txt
inquiry.html   http://kowalskifurnituredesign.com/forms/inquiry.html.txt

I did not write the script. do the errors mean I should just try a new script. Say formmail.pl form matt script archive ?

ASKER CERTIFIED SOLUTION
Avatar of Perl_Diver
Perl_Diver

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of FishMonger
I was going to see if we can clean up your current script(s) enough to get you going, but after looking them over, it's not worth the time/effort.  For example, the section of code that calculates the date and time is 223 lines long!  That's the longest method that I've ever come across!  By using the strfime function from the POSIX module, that can be reduced to just a couple lines.  There are numerous other issues with it, but I'll leave them alone.

I agree with Perl_Diver, you should drop BizMailForm script and instead use the nms FormMail script.  It's the best FormMail script that I know and the original version was written by davorg, which is one of our other EE experts.  https://www.experts-exchange.com/M_1168660.html.
thank you for the time and effort in looking at the script, I will change to your recommended script. Thank you