  phpEasyMail

  Version 2.0 - 04/05/1999
  Authors: Tobias Ratschiller <tobias@dnet.it>
           Jason Birch <jason@psp.pair.com>
  see bottom for version history

  Description:
    This is Yet Another Form2Mail Script. 

  Requirements:
    PHP3 - tested with 3.0.6
    MySQL if you want logging - untested
                
  Summary:
    phpEasyMail is intended to send HTML-forms via email
    in a formatted style. Additionally, some simple statistics
    can be provided for the adminstrator.

  Two versions?
    Yes, there are two versions of php{Easy}Mail included:
    - phpEasyMail is the same as earlier versions, but with added functionality.
    - phpMail is a complete rewrite to allow calling it instead of calling an HTML page.
    You can choose which one best suits your needs.  The second version is a bit
    more powerful in that it can report on what fields are missing, whether an
    email address is incorrectly formatted, whatever, while the first version
    is somewhat easier to configure.

  Getting Started (phpEasyMail.php3):
    - create an HTML page to input a form (see from.inc for examples)
      as well as a success page and a failure page.
    - have the form HTML page call phpEasyMail.php3
    - modify the defaults.inc file to suit your preferences
    - set up your database if required (see Logging below)

  Getting Started (phpMail.php3):
    - rename the file phpMail.php3 to something that suits your form
    - modify the defaults.inc file to suit your preferences
    - change the HTML in "header.inc", "footer.inc", "form.inc",
      "welcome.inc", "missing.inc", "badfrom.inc", and "thanks.inc"
      to match your site.
    - set up your database if required (see Logging below)

  The Form Interface:
    The form which is called by phpEasyMail.php3 controls 
    the script by form-variables:

    to           The target email-address.
    from         The sender's email-address.
    subject      The subject of the email.
    extras       Any extra headers to include in the mail
    required     Used to enter the fields (comma-separated) which must
                 be filled out by the sender.
    template     A template for the email-body. Variable-names 
                 are enclosed with "%".
    autofrom     Who the autoreply should be from.
    autosubject  The subject of the autoreply.
    autoextras   Any extra headers to include in the autoreply
    autoreply    If the inquiry should be answered with an auto-reply, you
                 can specify the text for it here. This uses the same format
                 as the template field.
    checkfrom    (En/Dis)able checks for valid email address
    log          Determines if logging should be enabled.
    logbodies    Specifies whether the body should be logged.
    askagain     Should the user be prompted for another submission? (phpMail only)
    url_error    Where to go when things go bad (phpEasyMail only).
    url_success  Where to go when things go good (phpEasyMail only).

    More information on these form-variables can be found in the
    config file "defaults.inc".  Just remove the "def" to get the
    variable name.

    Examples of how to use these in a form can be found in the
    included file: "form.inc"
    
    All variables are optional as long as you set up default values for them
    in the config file.  If you don't specify a template, all form-variables
    are sorted and inserted line by line into the email-body.

  Logging:
    Logging requires MySQL and MySQL-support in PHP3.  A text file (phpEasyMail.sql)
    has been included to give you the table format.  Be sure to change the table
    name when creating the table if you change the value of $table in the
    "dbase.inc" file.

  Configuration:
    All configuration options can be found in the well-documented
    file "defaults.inc".  There are quite a few more in version 2 than
    there were in version 1, but all the new ones can be ignored until
    you find a need for them.
 
  Differences from 1.x
    - Primarily, the addition of phpMail to the distribution.
    - Optionally, allows user to post another message after first.
    - Several added configuration options, including the ability
      to supress mail (log and/or autoreply only) as well as the
      ability to log message bodies, and more control over the
      autoreply function.
    - Code has been modularized for easier maintenance.

  Todo:
    - Any suggestions?

  Files:
    readme             - This file (you're reading it)
    phpEasyMail.php3   - Forms processor version.
    phpMail.php3       - Forms generator version.
    common.inc         - Common functions for both versions.
    defaults.inc       - Configuration defaults.
    dbase.inc          - Database setup file.
    files.inc          - Filenames for HTML chunks.
    form.html          - HTML form including required fields.
    header.html        - HTML display header.
    footer.html        - HTML display footer.
    welcome.html       - HTML welcome message.
    missing.html       - HTML missing required fields message.
    badfrom.html       - HTML bad email address message.
    thanks.html        - HTML thank-you message
    phpEasyMail.sql    - A MySQL dump of the logging table.
    phpMailStats.php3  - A simple statistics page.
    percent.gif        - support file for the stats program
    percentoff.gif     - support file for the stats program
    styles.css         - A style sheet for the stats program.

  Version History:
    v 2.0.0 - 04/05/1999: Initial rewrite by Jason Birch
    v 1.1.0 - 03/02/1999: Bugfixes in the stats-part.
                          Added auto-reply.
                          Added check to see if the from-address is valid.
    v 1.0.1 - 09/26/1998: Added stripslashes().
                          Changed min(t_stamp) to now().
                          Changed $REMOTE_ADDR to GetHostByAddr($REMOTE_ADDR).
                          Added number_format to Avg. Mails/Day.
    v 1.0.0 - 09/19/1998: First release. Added percent-bars.
    v 0.9.0 - 09/09/1998: First internally used version
 
