Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

how to send the field values through email (perl)

Hello all,



can anyone clarify me how to send the fields value through mail in perl with example.





satheesh


Comments

  • Hi!

    Check out the Formmail script available on this page:-

    http://www.worldwidemart.com/scripts/formmail.shtml

    I've used it at my site before now, and I've never had any problems with it.

    Hope this helps - and Merry Christmas!

    Jonathan


    URL:http://www.downloadcounter.com/

  • : Hello all,
    :
    : can anyone clarify me how to send the fields value through mail in perl with example.
    :
    :
    : satheesh
    :

    Look on the internet for a file called cgi-lib.pl .. this will make form handling a lot easier for you .. the program you want to use for emailing would be sendmail ..

    Read in your variables .. for example, say your HTML form element was called "name" .. another was called "email"...

    first make sure you call the cgi-lib.pl file and call the function for parsing form data .. of course, your path to perl is probably different...

    =============================
    #!/usr/bin/perl
    require "cgi-lib.pl";
    &ReadParse(*form_data);

    $name = $form_data("name");
    $email = $form_data{"email"};
    ===============================

    Then, using sendmail, send the data to your e-mail address..

    ====================================
    $mailprogram='/usr/sbin/sendmail';
    {unless (open (MAIL, "|$mailprogram -t"))
    {
    print "Error opening sendmail program.
    "; }
    print MAIL "To: You
    ";
    print MAIL "From: Your Program ";
    print MAIL "Subject: Your subject line

    ";
    print MAIL "Name: $name
    ";
    print MAIL "Email: $email

    ";
    close (MAIL);
    }
    ===================================

    Obviously, you would put the correct path to your sendmail program in the $mailprogram variable -- if you don't know it, ask your hosting company -- if they don't know, get a new hosting company .. lol ..

    Help this helps you out .. if not, try WDVL .... they have some good links on Perl programming .. read Selena Sol's articles..



    URL:http://www.wdvl.com

Sign In or Register to comment.