Retrix Hosting provides a mailer script for our customers to use with forms on their website. The script will take whatever someone enters into a form, and will email it to the webmaster of the website.
The form action must be /retrix_global/mailer/, and the method, POST.
The script uses a series of special variables to control it:
|_FROM||When the form is emailed, this variable will be used as the “Reply-To:” field in the email. Although this field is not required, if it is included, it will be validated using a regular expression. Default value: email@example.com|
|_TO||The email address to which the contents of the form will be emailed. This email address must use the same domain as the website on which the form resides. For example, if your website is “example.com”, then the _TO variable must be set to something like “firstname.lastname@example.org”. (”webmaster” can be any valid user at your website.) Default value: webmaster@[your domain.com]|
|_SUBJECT||The subject used in the email that gets sent.|
|_MESSAGE||The message body.|
|_MESSAGE_REQUIRED||Must be set to “1″ or “0″. If you do not want to your form to have a required message field, set this variable to “0″. Default value: 1 (on)|
|_REDIRECT||Once the form is successfully filled out, the user will be taken to a generic Retrix Hosting page which says “Your message has been sent”. If you would rather direct the user to a custom page on your site, you can set this variable to an absolute path (eg. /thanks.html) or URL (/thanks.html).|
|_SUCCESS_MESSAGE||If not using _REDIRECT, you can optionally set the message that is displayed to the user on a successful submission.|
|_RETURN_BOOLEAN||Must be set to “1″ or “0″. If set to “1″, the form will return a single “true” or “false” depending on whether or not it was successful in sending. This is useful if your form is in a Flash movie, and you want to keep the user within the movie rather than directing them to a regular page on submission. Default value: 0 (off)|
|_DEBUG||Must be set to “1″ or “0″. If set to “1″, the script will output various bits of debug information into your website’s error log. Your website’s error log can be located from within your home folder’s Logs/error_log-[domain]. If you are a shell user, you can monitor this log by typing something like “tail -f ~/Logs/error_log-[domain]” where [domain] is the domain of your site (eg. example.com). Default value: 0 (off)|
|VARPREFIX||*Advanced* It was brought to our attention that Flash will not let you name a form variable if it starts with an underscore (”_”). Our solution was to introduce a variable called “VARPREFIX” which defines the prefix that will be used in front of all of the above, special variables. For example, if you set VARPREFIX to “RT”, then the script will look for variables named “RT_FROM”, “RT_TO”, etc. instead of “_FROM” and “_TO”, etc.|
Any other form fields you add will be included to the mail sent to you.
If you would like to add a form your website, you can start by copying the following block of code, and pasting it into a page on your website: