#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2000
    Posts
    2
    Rep Power
    0
    Hi,
    i have an HTML form with two Text areas and a button. After I type the contents into the Text Area, if I press the Button, a mail should be sent to a default person with the message containing the contents of the text areas.
    How can I do it with perl? Cant I do it with client side JavaScript?
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Posts
    82
    Rep Power
    14
    Here:

    #!/usr/bin/perl

    use CGI;
    $query = new CGI;

    $first_textarea_data = $query->param('textarea_a');
    $second_textarea_data = $query->param('textarea_b');

    $mailer = "/path/to/sendmail";

    unless(open(MAIL, "|$mailer -t")) {
    print "Unable to open sendmail at: $mailernn";
    exit;
    }

    print MAIL "TO: recipient@some.comn";
    print MAIL "SUBJECT: This is some fine mail!n";
    print MAIL "FROM: you@your.comnn";

    print MAIL $first_textarea_data;
    print MAIL $second_textarea_data;

    close(MAIL);

    print "Location: <A HREF="http://www.foo.com/your_thank_you_page.htmlnn";" TARGET=_blank>http://www.foo.com/your_thank_you_page.htmlnn";</A>

    have phun.

    Josh

IMN logo majestic logo threadwatch logo seochat tools logo