Formmailer v1.74 ------------------ 1. Installation 2. Version 3. Updates 4. Problems 5. Fieldnames 6. Fields 7. Templates and Language 8. Confirmation-Pages 9. Error-Pages 10. Settings 11. Sorting 12. Calculate 13. Excel and CSV 14. Multipage Forms and Placeholder 15. Compatibilities 16. Safety Issues 17. History 18. Licence 1. Installation: >------------------------------------------------------------------------------------------------------< a) Extract the Zip File using WinZip, WinRar or the buildin Extracter (WINXP) b) Save the Files on your Computer. c) Start your FTP-Program and connect to your Domain usint your Internet Service Provider (ISP). d) Check if you require a certain CGI-BIN Folder or if the Script runs in every Folder. Your ISP can give you Some Advice. Your rented Webspace has to allow own CGI-Bin Scripts. In most cases rented Webspace-Packages allows it. Only in smaller Webspace-Packages it might not work and needs to be ordered !! e) Open the CGI-Bin Folder or create a Folder with the Name CGI-BIN and open it. f) Inside the Folder "CGI-BIN" create a folder "mailer". The Folder also can be a Name you choose. Change to the Folder "mailer" g) Change your FTP-Program to Mode ASCII. FTP-Programs usually have 3 different Modes: ASCII BINARY and AUTO. h) Copy all files from the local cgi-bin Folder to the Folder "mailer" on your Webspace: Setting the access of the files: CHMOD "mailer.cgi" to 755 CHMOD "flood.txt" to 777 CHMOD "sessiongrafik.txt" to 777 More Information about CHMOD can be found under http://www.coder-world.de/cw/seite__pagezugriffsrechte.html i) Start your Browser and enter following Url: http://www.YourDomain.de/cgi-bin/mailer/mailer.cgi If you can run the above Url, rename /mailer-data/txt.htaccess to /mailer-data/.htaccess j) You should enter your Email-Adress. There are two Ways: 1) in index.html change following Line 2) Set your emailadress $empfaenger in mailer.cgi You also should set the Value $domains (can be found in mailer.cgi) k) Now you can setup the Script and the files to your liking Read the Hints under Section 14 l) Some examples are included. 1) Normal Formmailer Run mailer.cgi 2) Formmailer with Upload-Display when Uploading Files Run mailer.cgi?temp=indexupload.html 3) Formmailer with some Javascript. Run: mailer.cgi?temp=indexjavascript.html 4) Formmailer with Preview-Option Run: mailer.cgi?temp=indexvorschau.html 5) Formmailer with multiple Pages Run: mailer.cgi?temp=indexseite1.html More Informations about the Installations can be found under: http://www.coder-world.de/cw/seite__pageinstall.html More Informations about Templates and HTML-Files can be found under: http://www.coder-world.de/cw/seite__pagetemplates.html Following Structure should be exist when the Folder is called "mailer": /mailer/mailer.cgi (chmod 755) /mailer/mailer-data/ (Folder, chmod 777) /mailer/mailer-data/save/ (Folder, chmod 777) /mailer/mailer-data/.htaccess /mailer/mailer-data/domains.txt /mailer/mailer-data/en_sprache.txt /mailer/mailer-data/ext.txt /mailer/mailer-data/flood.txt (chmod 777) /mailer/mailer-data/ips.txt /mailer/mailer-data/mail.txt /mailer/mailer-data/sessiongrafik.txt /mailer/mailer-data/sprache.txt /mailer/mailer-data/zensur.txt /mailer/responder/1.txt /mailer/send/1.txt /mailer/templates/error.html /mailer/templates/error2.html /mailer/templates/fertig.html /mailer/templates/index.html >------------------------------------------------------------------------------------------------------< 2. Version >------------------------------------------------------------------------------------------------------< To see your Version of the Formmailer, just run Following http://www.ihredomain.de/cgi-bin/mailer.cgi?action=version >------------------------------------------------------------------------------------------------------< 3. Updates >------------------------------------------------------------------------------------------------------< When youre Updating the Formmailer, you generally only need to replace "mailer.cgi" >------------------------------------------------------------------------------------------------------< 4. Problems >------------------------------------------------------------------------------------------------------< If you get the Error-Message "sendmail not found" or you cant send Email, so search for the following in "mailer.cgi" : $mailprog = ""; replace it with $mailprog = "/usr/bin/sendmail"; # See Remarks ! Remarks: You need to change "/usr/bin/sendmail" to the correct sendmailpath of course (ask your Provider when in doubt). The Change is only be needed if you get the ErrorMessage. >------------------------------------------------------------------------------------------------------< 5. Fieldnames >------------------------------------------------------------------------------------------------------< Here is a list predefined Fieldnames. Naming of fields should only consists of A-Z,a-z,0-9,-,_ All Fieldnames without Function can be used freely. All other Fieldnames should be in this Manual. action, to, from, fertig, subject, bcc, cc, back, check, checkz, next, nextsite, error, auto, aktiv, htmlresponder, html, urlcheck, mailcheck, space, anzahl, redirect, missing_fields_redirect, nosort, nofrom, browsersort, sort, sort_fields, required, recipient, session, to_email, email >------------------------------------------------------------------------------------------------------< 6. Fields >------------------------------------------------------------------------------------------------------< You can use infinite amounts of Fields of every type in each Form. You also can have an infinite Amount of File-Attachments. Following needs to be checked: Multiple Fields for File-Attachments are possible, but each Description of the Field has to start with "file-upload-" and end with an digit (example file-upload-01, file-upload-02, ...) And for rename field for each File-Attachment: Additionaly needs the Form-Tag in the "File-Attachment" Section following Line:
>------------------------------------------------------------------------------------------------------< Now we show you how you create multiple DropdownBoxes. This means that in One Dropdownbox you can select multiple Choices. Now we show you how to create Readonly Fields. This means that the User sees a normal Field, but cant change anything in it. >------------------------------------------------------------------------------------------------------< 7. Templates and Language >------------------------------------------------------------------------------------------------------< You can create multiple Forms that you can use, including multipage Forms. Just create in the Folder "templates" a new Form, like "test.html" and Run the Formmailer using "mailer.cgi?action=index&temp=test.html" Now the New Form will be Displayed and used. Alternate you can use this on a Button as hidden Field: INCLUDE-Function in the Templates http://www.yourdomain.tld/file.html just add it anywhere you want it to display contents of external pages. You need the modul LWP-Simple on the server. Languagefiles select in form: or as value: mailer.cgi?sprache=en_sprache.txt Uploadshow: or as value: mailer.cgi?uploadanzeige=uploadanzeige.html >------------------------------------------------------------------------------------------------------< 8. Confirmation-Pages >------------------------------------------------------------------------------------------------------< You can use different or multiple Confirmation-Pages. Either you insert it in the Form-Tag using Following example: "gesendet.html" is the Filename in the Folder "templates" thats getting displayed afterwards. The Advantage comparing to Forwarding (described later) as Confirmation is, that you can use all Placeholders. Alternative Use can also be a hidden Field, works the same way and looks like this: Formmailer gets the Instruction to load a different Template. You also can point to an Internet-Adress: or Disadvantage by using this Method: You cant use Placeholder. >------------------------------------------------------------------------------------------------------< 9. Error-Pages >------------------------------------------------------------------------------------------------------< You can use custom Error-Pages. For that you can use a hidden Field, and it looks like: or "gesendet.html" is the Filename in the Folder "templates" thats getting Displayed. The Advantage comparing to Forwarding (described later) as Confirmation is, that you can use all Placeholders. Remark: The File has to be in the Folder "templates". Use The Placeholder <_fehler> for the Errormessage. You also can point to an Internet-Adress: or Disadvantage by using this Method: You cant use Placeholder. >------------------------------------------------------------------------------------------------------< 10. Settings >------------------------------------------------------------------------------------------------------< $savefiles = "0"; # 0=OFF and 1=ON for save files and not as mail attachment. $savePfad = './mailer-data/save'; # Directory for the files $offline = "0"; # 0=OFF und 1=ON for Domain-Check # Here you can setup, if you only can access the Script from certain Domains (see domains.txt) $TimeZoneOffset = "0"; # TimeZone # Enter your TimeZoneoffset or leave it the way it is now. # Timezones are from -12 to +12 $extaus = "0"; # Here you can Set "Check File-Extension" (0=Off, 1=ON) $bytes = "150"; # in Kilobytes. Here you can restrict the Filesize of the possible File-Uploads $error = "1"; # Errormessage when encountering wrong Extensions (0=Off, 1=ON) $flood = "1"; # FloodProtection (0=Off, 1=ON) $floodzeit = "60"; # This sets the time in seconds until you can send a message again $empfaenger = "name@domain.de"; # Only enter if you dont want to enter an recipient in Forms. # Defines an Email-recipient. If you enter an recipient all defined recipients in Forms will be invalid and this one will be used. # Multiple recipient can be entered using "," as divider $ARabsender = ''; # Like in $empfaenger this option defines an sender for the automatic confirmation (Autoresponder) # Optional, can be used if you want a differend Sender than the recipient-Adress. $multiple = "1"; # 1=Komma, 2=Space - This Means Fields with multiple Choices or same Fieldnames, they will be displayed separated. $felder = "1"; # (0=Off, 1=ON) # This Option (if you use sorting) cuts out nonfilled fields, so that E-mails look "good" and easy readable. $felderLINE = "1"; # (0=Off, 1=ON) # This Option (if you use sorting) cuts out nonfilled fields including all following empty rows, so that E-mails look "good" and easy readable. $felderAUTO = "1"; # (0=Off, 1=ON) # This option hides empty Fields when generating the E-Mail. $gen = "0"; # 1=ON, 0=OFF - This option auto-generates hiddenfields. The placeholder for multiple Pages is $domains = ""; # Here you can define all domains that gets accepted as recipient. # example domain.de, mydomain.de, anotherdomain.de etc. # do NOT add "http://" and "www." and NO "/" at the end! # also dont add paths, just the Domain only. # You only need to enter values if the above function "$empfaenger" is empty. # If you dont want to use this Function, just leave it empty. $mailprog = ""; # If sendmail can not be found, you can enter the Full Path here. Usually you dont need to enter anything here. $temppfad = "/tmp"; # temppath for temporary files while saving # Normaly the folder "/tmp" exists, if not then enter a path to a folder with writeaccess (chmod 777) $smtp = "0"; # 1=ON/SMTP - 0=OFF/Sendmail # here you can define if youre using SMTP or SENDMAIL $timeout = "300"; # timeout in seconds where the script tries to connect to the SMTP-Server $SMTPusername = ""; # Username for SMTP-Access. Free SMTP-Server usually dont require this. $SMTPpassword = ""; # Password for SMTP-Access. Free SMTP-Server usually dont require this. $SMTPserver = "localhost"; # example smtp.domain.de , when in doubt ask your Provider $SMTPtyp = "LOGIN"; # Depending on Configuration the Login will be transmitted secured. # Possible Types are ANONYMOUS, CRAM_MD5, DIGEST_MD5, EXTERNAL, LOGIN, PLAIN $POP3abfrage = "0"; # (0=Off, 1=ON), Some Server require that you check Mails before you are allowed to send Mails. $POP3username = ""; # Username for POP3-Access. $POP3passwort = ""; # Password for POP3-Access. $POP3server = "pop3.domain.tld"; # example pop3.domain.de $returnpathconfig = "0"; # (0=Off, 1=ON) - Return-Path # If a Mail cannot be delivered, the Errormessage from the MTA (Mail Transport System) will be send here # like if the emailrecipient doesnt exist, or the Mailbox is full. # If you have trouble with sending mails, than disable this function. # "return-Path" will be adapted from the recipient-Emailadress. $excel = "0"; # (0=Off, 1=ON) - CSV # This Option determines if a CSV-File will be generated. More on this later. # This Option has to be enabled if you want to use CSV- or Excel-Export in the Form. # This Option needs to be activated otherwise the option in the form wont work. # The E-Mail will still be sent. File-Attachments wont be saved. $checkboxOption = "0"; # 0=OFF und 1=ON # Checkboxes without value will be filtered. Browser will send "on" as Value if you click checkboxes without value. $flock = "1"; # 0=OFF - 1=ON # Prevents Data-Loss when accessing the Script simultan with more than 1 User. $gzip = "0"; # 0=OFF - 1=ON # GZIP Compression - Compresses the Data thats being transferred to the User so it will cause less traffic and will be slightly faster. $internerPfad = '.'; # Internal Path to mailer.cgi without Filename. # You only need to enter it if you get Errormessages that files Can not be Found! /domains.txt: Here you enter Domains that should have Access to the Script/Form, This is only required if you have enabled that Function in the startsection of mailer.cgi /ips.txt: Here you enter IP that should have no Access to the Script/Form, This is only required if you have enabled that Function in the startsection of mailer.cgi /templates/index.html: You can adapt the File to your Likings. <_m> is the Placeholder for recipient, Sender and Subject. <_ausgabe> is the Placeholder for Messages and Output of Results. /templates/error.html: Here are the possible Errors, that might appear. You can adapt the File to your Likings. /templates/fertig.html: Here you get the Confirmation that the Form was being sent. You can adapt the File to your Likings. /ext.txt: Here you can determine what File-Extensions are being allowed. /zensur.txt: Censorship. If these words exist in the form when you try to send it, it wont be sent and you get an ErrorMessage. 1 Word per Line. /sperre.txt: Ban Sender Email-Adresses. Use name@domain.de to Ban one certain Email-Adress or use *@domain.de for the whole Domain. /sperre-empfaenger.txt: Ban recipient Email-Adresses. Use name@domain.de to Ban one certain Email-Adress or use *@domain.de for the whole Domain. /flood.txt: Do not change the File. /mail.txt: instead of $domains, domains.txt and $empfaenger you can use this File,too. example: (Case sensitive) Common=webmaster@domain.de Support=support@domain.de Double=test@domain.de,second@domain.de Before the "=" may only Characters A-Z, a-z, 0-9, - , _ be used. In The Form the Field may look like this: you can also use 2 Mail-Adresses (you can also supply multiple Mail-Adresses divided with "," in the File) or as DropDownbox with multiple Choice: Of course you can use it with all types of Inputfields, as example Radio- or Checkboxes /responder und /send Create as many Textfiles as you need. >------------------------------------------------------------------------------------------------------< If you want to use the Autoresponder, you need to insert this Line into the Form: Here you define a different template with data for the text thats being sent to you. Replace 1.txt with the file you wish to use so that the correct template will be used when sending. Filename should be in folder "send" and only contain Digits and Chars. You can use subfolders aswell: Here you can activate the Autoresponder (automatic Reply). The User who uses the Form gets an automatic reply. Replace 1.txt with the File you wish to use so that the correct Template will be used for the Autoresponder. Filename should be in Folder "responder" and only contain Digits and Chars. You can use subfolders aswell: HTML will be used in the Form and E-Mails will be send in HTML. HTML will be used in Autoresponder and automated Replys will be in HTML. In Both cases (Autoresponder, Sendmail and in "fertig.html") can you use following Placeholders: <_ausgabe> Outputs all Fields (File-Attachments will only be send when sending Emails, not in Autoresponder) <_name> = Content <__name> = Name: Content "Name" is the Fieldname used in the Form. So you can design and sort the layout of the E-Mail and ConfirmationPage to your Likings. The Placeholder for automaic Sorting / Insert "<_ausgabe>" should be removed if you sort manually. "name" is the Placeholder thats being used in the Field. It contains the Data from The Form with the "name" Field. Fixed Placeholder: <_subject> = Subject <_to> = E-Mailadress from recipient <_from> = E-Mailadress from Sender Just create more Templates if you have more Forms. >------------------------------------------------------------------------------------------------------< 11. Sorting: >------------------------------------------------------------------------------------------------------< In General Fields will be sorted alphabeticly. Sorting from Browser is possible with following Line: If you dont want Sorting, use this Line: You can also use a Hidden Field in the Form to sort: or Fieldnames have to be separated with "," If a Field not listed under "sort", it will just be appended, unless you use "browsersort". >------------------------------------------------------------------------------------------------------< 12. Calculate >------------------------------------------------------------------------------------------------------< To activate this Function you need to set $rechnen=1 in File "mailer.cgi". For Security Reasons the Calculation works over Javascript. It is more Userfriendly and secure. The Script still contains Serverside Calculations with Timeout of max 5 seconds per Calculation. You can use the Following Pages or in all E-Mail-Templates these Calculations: [<( [age] / 3 )>] - creates the Result [age] divided trough 3. [<( ([field1] + [field2] + [field3]) * [tax] )>] - adds the Fields and multiplicates the Sum with the Field tax. All Calculations have to be written in a certain Formula: [<( Calculation )>] >------------------------------------------------------------------------------------------------------< 13. Excel and CSV >------------------------------------------------------------------------------------------------------< It is possible to save the Formdata in a CSV-File so you can use it within Excel. In the Form following needs to be integrated: Inside mailer.cgi you have to set $excel=1 otherwise it wont work. If you dont have the Field integrated the Scritp will save the Data in /mailer-data/csv.dat It is possible to save the Data in a File without sending an E-Mail with: Autoresponder witht the option nextsite: In the Folder "mailer-data" the File will be created and appended if the Form is being used. Check http://openoffice.org for Openoffice Application. >------------------------------------------------------------------------------------------------------< 14. Multipage Forms and Placeholder: >------------------------------------------------------------------------------------------------------< You also can create multipage Forms. Just use "" inside the Forms. Using this Placeholder will generate all Fields excluding File-Attachments as hiddenfields. You need to set $gen=1 inside mailer.cgi to make it work. You need to use the Option to forward the Form to the Next Form instead of the Confirmationpage (see below). The Confirmationpage "fertig.html" needs to have the above mentioned Placeholder. You also can edit all Fields manualy, see above (<_name, <__name>, <_name2> , <__name2>) You can create nearly infinite Forms. Although you cant passover File-Attachments at the Moment (not yet included). If you need File-Attachments then i suggest you place those on the last Form. Using this Line allows to load the next Form after send: Remark: The File has to be in the Folder "templates". To Disable Email-Sending while loading the next Form use following line: >------------------------------------------------------------------------------------------------------< Special ENV-Placeholder: <_env-proxyip> = Proxy-IP, if the user is using an Proxy. <_env-ip> = Normal (Real) IP-Adress from the User. <_env-browser> = Informations about the used Browser <_env-herkunft> = Origin of the User <_env-user> = If the Formmailer is behind htaccess this Placeholder will contain the Username. These Special ENV-Placeholder can also be used in Autoresponder and "ferig.html". >------------------------------------------------------------------------------------------------------< Special Date and Time-Placeholder: <_datum> = will result in "<_from> from <_thisday>, <_mday> <_thismonth>, <_year> um <_hour>:<_min>:<_sec>" <_thisday> = Day as Word <_thismonth> = Month as Word <_year> = Year as Word <_mday> = Day as Digits <_hour> = Hour <_min> = Minute <_sec> = Seconds These special Placeholders can also be used in Autoresponder and inside Confirmationpages. >------------------------------------------------------------------------------------------------------< CID-Pictures: (integrated Pictures in HTML E-Mails) First the Picture has to be in the attachment (example File-Attachment) It will be inserted like normal Pictures in HTML, the difference is the "cid:" before the Filename: