Thread: Please help!!

    #1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    179
    Rep Power
    15
    I want to send the result of the get_form_data subroutine to a specified email address. The function name gets printed in the email and that's it. Any suggestions?

    #!/usr/bin/perl -w

    # kasday.cgi

    use CGI ":standard";
    $q = CGI->new;

    open (SENDMAIL, "|/usr/lib/sendmail -oi -t -odq") or die "Can't openn";
    print SENDMAIL <<EOF;
    From: Whoever <wherever@wherever.com>
    To: Whoever <wherever@wherever.com>
    Subject: A testing email

    Testing some text.

    get_form_data()

    EOF
    close(SENDMAIL) or warn "didn't close";


    print header();
    print "<html><body>";

    get_form_data();


    print "</body></html>";

    sub get_form_data {
    @form_keys = $q->param();
    foreach $form_name (@form_keys) {
    $form_value = param("$form_name");
    print "($form_name): $form_value n";
    }
    }

    ### THANKS!!!
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Aug 2000
    Location
    Indiana
    Posts
    614
    Rep Power
    15
    Yes, don't use CGI.pm... as everybody can obviously see it only causes unneeded confusion.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    179
    Rep Power
    15
    I understand your suggestion but it hasn't enlightened my situation any. The function get_form_data works as it is printed to a web page but I don't understand why it won't print to the sendmail for the email recipient. What is going on?

    Thanks for the reply.
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    179
    Rep Power
    15
    I realize what I did wrong in the above code. I was missing something in the syntax.

IMN logo majestic logo threadwatch logo seochat tools logo