Mike Schilli's Friendly Neighborhood Perl Shop

Home
USArundbrief.com
Resume
CPAN Modules
Articles in English
Articles in German
Mike's Script Archive
English-Japanese Translation Trainer
Adventures with O'Reilly's Safari
10 Easy Steps to Become a California Driver
Unofficial perlmonks.com IRC Channel
My Collection of Outage Pages
Prisma (Computer Club Deutschland)
Mike's Monologues
Mike's Script Archive: newman

newman - a simple CGI script to send mail from web forms


NAME

    newman - a simple CGI script to send mail from web forms


DOWNLOAD

newman


SYNOPSIS

    newman fields="f1,f2" f1=hello f2=world from=from@from.com \
           to=to@to.com subject="My Subject" \
           thanks_url=http://perlmeister.com/thanks.html


DESCRIPTION

newman is a CGI script that's meant to be referenced from a HTML form like this:

    <FORM ACTION=/cgi/newman METHOD=post>
        <TEXT NAME=f1 VALUE="hello">
        <TEXT NAME=f2 VALUE="world">
        <HIDDEN NAME=fields     VALUE="f1,f2">
        <HIDDEN NAME=from       VALUE="from@from.com">
        <HIDDEN NAME=to         VALUE="to@to.com">
        <HIDDEN NAME=subject    VALUE="My Subject">
        <HIDDEN NAME=thanks_url 
                VALUE="http://perlmeister.com/thanks.html">
        <SUBMIT>
    </FORM>

It will examine the fields variable first and extract the comma-separated list of field names from there. Then it will build an email body listing all the different fields specified like

    f1:
        hello
    f2:
        world

and send it to the address given in the to parameter, using the subject line defined in subject and the from address given in from. It will use a locally installed sendmail process to deliver the mail.

After that's done, it will redirect to the URL given in thanks_url, which will typically just display a ``Thank you!'' page.


LEGALESE

Copyright 2003 by Mike Schilli, all rights reserved. This program is free software, you can redistribute it and/or modify it under the same terms as Perl itself.


AUTHOR

2003, Mike Schilli <m@perlmeister.com>


Latest update: 20-Oct-2013