My project is almost done and i just wanted to share what code i have finished.  
Thanks so much for the input/help i've recieved here!

~~~~~~~~~~~~~~~~~~ Start of Code ~~~~~~~~~~~~~~~~~~

use CGI qw/:standard/;
use DBI;
use Net::SMTP;

$| = 1; 
open(STDERR, ">&STDOUT");

       print header,
            start_html('Enter Information'),
            h1('Enter Information'),
            start_form,
            "Customer Number : ",textfield('cn1'),p,
            "Password : ",password_field('pw1'),p,
            "Name : ",textfield('name1'),p,
            "Email : ",textfield('email1'),p,
            "Problem : ",textfield('problem1'),p,
            submit,
            end_form,
            hr;

       if (param()) {
           print "Customer Number Entered : ",em(param('cn1')),p,
                 "Password Entered : ",em(param('pw1')),
                 hr;


$custnum1 = param('cn1');
$passwdx1 = param('pw1');
$name1 = param('name1');
$email1 = param('email1');
$problem1 = param('problem1');

my $dbh = DBI->connect( "dbi:mysql:nextek", "xxxx", "xxxxx" ); 
# or die "Can't connect to MySQL Database: $DBI:errstr\n";

$sth = $dbh->prepare("SELECT custnum, password FROM support WHERE custnum= ?");
$sth->execute($custnum1);

while ( my @row = $sth->fetchrow_array() ) {
          $actualpw = $row[1];
          if (not defined $actualpw) {
                  print "Invalid!",
                  hr;
          } elsif ($passwdx1 eq $actualpw) {
                  print "Ok!",
                  hr;
                  $servername = "nextekfs1";             
                  $smtp = Net::SMTP->new('mail.something.com',
                                          Hello => 'mail.something.com',
                                          Debug => 1,
                                         ) or die; 
                  print $smtp->domain,"\n";
                  $MailFrom = "support\@something.com"; 
                  $MailTo = "ksmith\@something.com"; 
                  $smtp->mail($MailFrom); 
                  $smtp->to( $MailTo ); 
                  $smtp->data(); 
                  $smtp->datasend("To: ksmith\@something.com"); 
                  $smtp->datasend("From: ksmith\@something.comt\n"); 
                  $smtp->datasend("Subject: Testing 1 2 3\n"); 
                  $smtp->datasend("\n"); 
                  $smtp->datasend("Here are all the cool new links...\n\n"); 
                  $smtp->dataend(); 
                  $smtp->quit(); 
            } else {
                  print "Wrong!",
                  hr;
            }
}

$sth->finish;
$dbh->disconnect(  );  
exit;

}

~~~~~~~~~~~~~~~~~~~ End of Code ~~~~~~~~~~~~~~~~~~~

Got this on my web server .. email.pl  ... runs great and does exactly what i want it 
to. Now just to pretty it up for the web and add my additional features.. Thanks again 
group and also big thanks to #perlhelp on irc.daxnet.no!!

Koie Smith
[EMAIL PROTECTED]
Nex-Tek, Inc.
Office : 731-989-2683
Cell : 731-343-0784
http://www.nex-tekinc.com

Reply via email to