##############################################################################
# DodosMail Version 2.5 #
# Copyright 2001 Ying Zhang http://pure-essence.net/about/contact #
# Created 09/04/01 Last Modified 11/23/06 #
# Regretless.com http://www.regretless.com/ #
##############################################################################
# COPYRIGHT NOTICE #
# Copyright 2001-2006 Ying Zhang. All Rights Reserved. #
# #
# DodosMail may be used and modified free of charge by anyone so long as #
# this copyright notice and the comments above remain intact. By using this #
# code you agree to indemnify Ying Zhang from any liability that #
# might arise from its use. #
# #
# Selling the code for this program without prior written consent is #
# expressly forbidden. In other words, please ask first before you try and #
# make money off of my program. #
# #
# Obtain permission before redistributing this software over the Internet or #
# in any other medium. In all cases copyright and header must remain intact.#
##############################################################################
================================================================================
About
================================================================================
DodosMail is an easy-to-install PHP email script for everyone.
This zip file includes
dodosmail.php - the php file that does the mail delivering
dodoscaptcha.php - the php file that does the captcha image
generation
readme.txt - instructions about how to install and
copyrights
header.php - default header file
footer.php - default footer file
reservoir.css - default css file
back.png - background image
test.php - demo how to use header and footer files.
captchaTest.php - demo how to use captcha
longform.php - demo how to use dodosmail for very long form
and expands to multiple pages.
test.html - demo backward compatibility
================================================================================
Requirements
================================================================================
A server that supports PHP. A server that supports http://php.net/mail function.
Some basic understanding of PHP includes.
================================================================================
What's New?
================================================================================
Now you may opt to use captcha to help spam protection.
Allows you specify a php header and footer file.
Backward compatible with older version setting.
An improved email checking function.
Compatible with checkboxes
Demo to show you how to use DodosMail with a long multi-page form
================================================================================
Installation
================================================================================
You should have some basic knowledge about form in html. Open test.html, you
will see a very basic sample form code.
hidden fields are:
-- put all the names of the required fields in here
-- put your real email address here or to do it a more secure way, check
out "Customize your email address" section
-- put "no" if you do not want the script to check the sender's email
address for validity.
-- you can have this field either as text or hidden. if it's text, then
sender may change the subject of the email freely, otherwise it'll be
the same subject regardless who sends it.
================================================================================
How to use captcha (take a look at captchaTest.php)
================================================================================
You must have PHP & GD library installed on your server for this to work.
First you must indicate in your form that you plan to use this feature by
putting the code below in your form:
Then you must include a field that allows the user to input the text and link
the captcha image by doing something like:
Spam protection (enter the text below):
Notice you may change the background and text color by passing the hexcode for
the two colors. If you do not pass in any colors, you will have black text on
white background.
If the image does not show up on your page after you have included the file,
it's most likely GD library is not appropriately installed. Please contact your
host for more information.
----------------REMEMBER----------------
The two variable names:
use_dodos_captcha
use_dodos_captcha_typed
They may only be used for captcha purpose.
----------------------------------------------------------------------------
following fields MUST appear if you wish to use captcha
----------------------------------------------------------------------------
Spam protection (enter the text below):
----------------------------------------------------------------------------
END OF following fields MUST appear if you wish to use captcha
----------------------------------------------------------------------------
----------------------------------------------------------------------------
following fields MUST appear if you wish to use php header and footer
----------------------------------------------------------------------------
----------------------------------------------------------------------------
END OF following fields MUST appear if you wish to use php header and footer
----------------------------------------------------------------------------
----------------------------------------------------------------------------
following fields should NOT appear if you choose to include php header and
footer
----------------------------------------------------------------------------
-- the html color code for page backgroud
-- the image name for background. you may put it as the format
"http://yourdomain.com/images/bk.gif"
-- the html color code for text color
-- the html color code for link text color
-- the html color code for visted link text color
-- the html color code for active link text color
-- the font you want to use for the output and error page
-- the font size
-- the highlight color for required field on error page.
for example:
The required field name is
empty.
-- if you have a css file you'd like to use, please fill it in,
otherwise leave it blank
----------------------------------------------------------------------------
END OF following fields should NOT appear if you choose to include php header
and footer
----------------------------------------------------------------------------
-- put "no" in the value if you do not wish the sender to get an auto
response mail from you.
-- replace "me" with YOUR NAME (the owner of the mail form)
-- the auto response mail subject
-- what do you want it to say in the auto response mail?
-- this is the url where you want the mail form to redirect to after it
has successfully sent the mail. if want the dodosmail to print an output
instead of redirect. just get rid of this line. if you got rid of it,
dodosmail will print something like:
The following has been sent successfully!
name: test
email: test@regretless.com
message: just a test
money: no money
food: need food
with your css file definition
================================================================================
IMPORTANT NOTE!
================================================================================
Please do not use the following variable names other than for layout purpose.
They are all reserved variable names.
"css_file", "background_color", "background_image", "text_color", "link_color",
"visited_link_color", "active_link_color", "font_name", "font_size",
"highlight_color", "required_fields", "after_url", "check_email_address",
"subject", "your_email_address", "env_report", "owner_name", "autoresponse",
"response_subject", "response_mail", "dodosmail_header_file",
"dodosmail_footer_file"
If you wish to use checkbox in your form, the name of your check box must end
with []. For example:
1
2
3
4
================================================================================
Modify Header and Footer
================================================================================
The values for your header and footer files can be modified at two locations.
put in the correct file names for:
in the form code
================================================================================
Add more fields
================================================================================
You can add as many new fields as you want. Please keep in mind name the fields
using smart naming techniques. NO SPACES!! ALWAYS USE UNDERSCORE!!! or your mail
script wont work!
for exmaple:
Who's your favorite singer?
================================================================================
Customize your email address
================================================================================
There are two ways to put your email address in this script. You can either put
it in the form as an hidden field or you can hide your email address from the
public and put it in the dodosmail.php
WAY ONE:
put in your correct address for:
in the form code
**********
advantage:
**********
without modifying dodosmail.php, you can call this script from anywhere
and as many times as you want.
*************
disadvantage:
*************
your email address is not really hidden, people can still find it out by
view source
WAY TWO:
open dodosmail.php
get rid of the "##" in front of
$your_email_address="you@yourdomain.com";
and replace you@yourdomain.com with your real email address
delete
in the form code
**********
advantage:
**********
your email address is now truly hidden from public. no one can view it
from the server.
*************
disadvantage:
*************
if you wish to set up another mail form to ANOTHER email address, you
must use a second copy of dodosmail.php
================================================================================
Comments or Suggestions
================================================================================
You are welcome to send comments or suggestions to
http://pure-essence.net/about/contact
However, do not expect a reply. That will depend on the complexity of your
problem and my schedule.
================================================================================
Script Log
================================================================================
09/04/01 started.
09/05/01 finished version 1.0 ;)
09/06/01 fixed a minor bug for env_report thing
09/06/01 added extra option to have dodosmail show mail output as well as
rediret. and released as v1.05
11/18/01 added extra option to allow auto response mail for your sender.
02/14/05 upgrading the script to Version 2.0.1
09/19/05 added global register code
12/02/05 upgrading the script to Version 2.1 by securing the script from header
injection
http://securephp.damonkohler.com/index.php/Email_Injection
11/23/06 upgrading the script to Version 2.5 by adding the captcha support