-----> NL-PHPMail 2.2 -----> README NL-PHPMail v2.2 Copyright ©2002-2007 Sasha, http://nothing-less.net. All rights reserved. First released December 11, 2002 This version modified by Amelie of Not-Noticeably.net for CodeGrrl.com, Released March 1, 2007. NL-PHPMail v2.2 is linkware and can be used or modified as long as this header remains intact and unaltered, and there is a link up back to http://codegrrl.com/ so people know where you got this script. You are forbidden to sell or distribute the code of NL-PHPMail v2.2, in whole or part, without the written consent of Sasha. By using NL-PHPMail v2.2 you agree to indemnify Sasha and CodeGrrl.com from any liability. Website: http://codegrrl.com/!/scripts/view/nlphpmail/ FAQ: http://codegrrl.com/!/faq/ Support: http://codegrrl.com/forums/ -----> SUMMARY Email the contents of any online form to yourself (or someone else, if you want it to). Very easy to set up and use. :) -----> REQUIREMENTS - PHP 4.2 or higher (with the GD image libraries for image verification). -----> FILES & FOLDERS IN THIS DOWNLOAD nlphpmail.php = the PHP script that sends the actual emails captcha.php = the PHP script that creates images for form verification form.php = an example form for use with nlphpmail.php verify.jpg = the verification image phpmail.gif = a small 80x15 button to link back with README.txt = the file you're reading :) -----> HOW TO INSTALL AND USE THE SCRIPT 1. Open up form.php and edit it to fit in with your website. Or alternatively, create your own HTML form (as long as it has a .php extension) and have it point to nlphpmail.php in the FORM tag, as you can see in form.php. Make sure you change this value to match the subject of the e-mail you want to be sent: If you are creating your own form page, remember to add this or your e-mail will have no subject (which some e-mail clients identify as spam, and some servers refuse to send). 2. Open nlphpmail.php in a text editor such as Notepad and read through the file, changing variables wherever asked to. There are clear explanations for every variable, so this shouldn't be too hard. 3. Upload the form, captcha.php, verify.jpg and nlphpmail.php to your webserver. They can be in any folder you wish, as long as they are in the same folder. If you upload nlphpmail.php into a different folder from the form, make sure you change the path in the FORM tag as well. IMPORTANT: YOU WILL NEED TO CHMOD verify.jpg TO 666 FOR THE SCRIPT TO WORK PROPERLY! 4. If you are writing your own form page, please make sure that you "name" your submit or send button "submit". If you do not do this, your form will not work. This is part of the spam protection and makes sure that your form was actually filled in from your page. Example: See the name="submit" part? That part MUST be included for the script to work. :) Another thing you must do if you are creating your own form is to include captcha.php (you only need to do this if you require the use of image verification - you should set this preference in nlphpmail.php). To do this: a) At the VERY START of your form page (which must have a .php extension for this to work), before any HTML or other PHP code, add this line: This code must appear before any content on your page, and there must be no whitespace above it. If you aren't making your own form, make sure that when editing form.php, you start editing beneath that code. b) Where you want the image verification to show up, use this code:
CAPTCHA Image
You MUST use the tag as written above. If you don't, you will be unable to send the form. Feel free to change the text and placement of the image around though (you cannot change the name of the image, so you must make sure the source of the image is "verify.jpg" and nothing else). :) Please remember that not everyone will be able to use your form if you are using image verification. A lot of people browse with images turned off, or use screen readers which can't decode the image, or simply can't see the letters and numbers on the image. Make sure that you have an alternative method for such users to contact you. If you aren't using image verification and are not making your own form, please make sure to delete the parts of code as specified in form.php (there are two parts to delete, make sure you delete both of them). You can then rename your form to .html if you so wish. Also, make sure you include the subject line in your form as detailed in step 1 above! Please note: If you are using image verification, you will need to refresh the form page if you get an error message (as a new image must be created). Simply pressing "back" on your browser will not be enough. You may wish to tell your visitors in your error messages. :) Also, the form will automatically clear itself in some browsers when refreshed for a new image. Please be aware of this if you expect long messages to be sent through your form. 5. That's it! If you are running into any errors with the script, please check the FAQ (http://codegrrl.com/!/faq/) and the Forums (http://codegrrl.com/forums/), the solution to your error might already have been posted there. If it hasn't, feel free to start a new topic in the forums for it. -----> ADDITIONAL NOTES This version of NL-PHPMail is compatible with multiple forms. All you have to do is to make another form page and point it to this script, remembering to change the subject field in the HTML. Your form will be sent to the same e-mail address as you specified for the script's original use, and will have the same required fields which means you must specify those fields in all forms pointed to this script. If you don't want this to happen, you will need to upload another copy of the script. :) -----> CHANGELOG Version 2.2: -Changed error handling to a function for easier integration -General code optimisation -Improved header injection protection and captcha -Fixed cleanup function so that entities are no longer escaped in e-mails received Version 2.1.2: -Added a few security fixes -E-mail address is now not required Version 2.1.1: -A couple of bug fixes regarding image verification Version 2.1: -Added image verification and further HTML validation to example form -Renamed form from form.html to form.php Version 2.0: -Added spam protection measures -Changed the name of the script from email.php to nlphpmail.php - hopefully spammers won't be able to find it as easily! -Fully compatible with register_globals disabled -Better e-mail verification - protects against spammers using your form to spam others -form.html is now XHTML 1.1 compliant -Script sanitizes input properly and is much harder to hack -Useable with multiple HTML forms! (Yay!) Version 1.5: -Changed the script to a zip file download instead of an online tutorial -Added an example HTML form -Added a link back button -Changed the setup of the script, with the variables at the top of the file so it's easier to edit and set up. -----> CREDITS Original script created by Sasha (http://nothing-less.net/ - Personal Site; http://codegrrl.com/ - Scripting Site) This version of NL-PHPMail edited by Amelie of Not-Noticeably.net for CodeGrrl.com. E-mail verification code from Zend.com and CodeGrrl.com Forums, posted by Jenny F aka OrangeSkidoo. Header injection protection uses part of a tutorial from Tutorialtastic (http://www.tutorialtastic.co.uk/) by Jem T. Image verification adapted from a tutorial by John, available from http://www.phpnoise.com/tutorials/1/1. -----> PROBLEMS? If you run into any problems with NL-PHPMail, please visit the CodeGrrl FAQ (http://codegrrl.com/!/faq/) to see if your problem has already been addressed. If it hasn't, please visit the forums (http://codegrrl.com/forums/) and search there. You should only start a new topic if you do not find ANY of the solutions helpful. We respectfully ask that you DO NOT email Sasha, Vixx or any other CG staff members personally about problems with this or any other of our scripts. Any such requests WILL be ignored.