Notes
- Most parameters may be supplied either by url or by file.
- If you are viewing this page offline after downloading, review the files uniformmail.params and example.params.
- All parameters take the form name = value.
- When supplied as part of the url :-
parameters must be separated using &.
some characters must be encoded (see below). - Parameters supplied by file override or limit the use of url parameters.
- The default file name is uniformmail.params.
- If a file parameter = ! the corresponding url parameter is disabled - blank is used.
If a file parameter = * a default value is used. For addresses, * means limit to this domain. - Email addresses may be calculated by combining, url and file parameters.
If the file parameter contains '@', the url parameter is ignored.
If the file parameter omits '@' it is assumed to be simply a domain name. In this case, the corresponding url parameter must omit the domain.
e.g. file param : to = geewhizz.com url param : to="Gee%20Whizz%20Support"<support@*> (The * character is optional.) The domain name specified in the file is combined with the partial email address specified in the url.
i.e. the form data will be sent to support@geewhizz.com
%20 is translated into <space>. - When email addresses are passed as url parameters, the '@' character may be replaced by '::' (double colon).
This may help to stop spambots locating email addresses in your html form pages.
| Parameter | Description | |||||||||
| params | This may be used to specify an alternative file to the default
of unformmail.params If the file is not found, the default is used. There is no corresponding file parameter. |
|||||||||
| mailserver | This must be set to the name of the smtp server. Typical values are smtp.yourdomain.com, mail.yourdomain.com, or simply yourdomain.com. Depending on your server configuration, other values such as localhost may also be valid. This may be set using an url parameter, but for security, this should be set using a file parameter. |
|||||||||
| domain | Generally, the file parameter should be *. This may be
used to limit addresses to the server's domain name. There is no corresponding url parameter. |
|||||||||
| referrer | Generally, the file parameter should be ! or blank. If specified it must be a domain name (omitting the www. prefix). This may be used to limit use of the script to a single domain by checking the HTTP_REFERER value. This is sent by the browser and can be disabled. If disabled or called from another domain, the script will fail. * may be used to represent the domain. There is no corresponding url parameter. |
|||||||||
| Addresses | See notes above. If a domain name is specified as the file parameter, the corresponding url parameter must use * as the domain name. |
|||||||||
| to | The primary recipient. | |||||||||
| cc | Carbon Copy - a list of addresses to which the mail should
be copied. Entries may be separated by commas or semicolons. Recipients of copies will see the same display name as the primary recipient. |
|||||||||
| bcc | Blind Carbon Copy - as cc except that the list of addresses
is not added to the mail header. Quoted display names serve no purpose but do no harm. |
|||||||||
| return | Generally, the file parameter should be !, however, if
you wish to be notified of mailing errors, you may assign another
value. This MUST NOT include a quoted display name. |
|||||||||
| from | Generally this should be set to something like "Uniform Mail"<uniformmail@yourdomain.com> | |||||||||
| replyto | Generally the file parameter should be ! | |||||||||
| body | Generally, the file parameter should be !. If the file parameter is blank, the body text may be specified using the url. If specified by url, linebreaks may be inserted using %0D, %0A or %0D%0A. If specified by file, only a single line of text is allowed. Body text is usually set using data posted by a form. Use of this parameter is not generally recommended but it may be useful in unusual situations. |
|||||||||
| charset NEW (v 1.5) |
Generally, the file parameter should be blank if the charset varies with different languages. |
|||||||||
| debug | If debug = 1, diagnostic information is displayed. If possible,
mail is still sent. Generally, the file parameter should be 1 when testing and ! when testing is complete. If the file parameter is blank, diagnostic information may be requested using the url. |
|||||||||
| maskchar NEW (v 1.5) |
The character used to mask out required values in the reply page. The default value is '#'. |
|||||||||
| maskfields NEW (v 1.5) |
A list of value names that should be masked out in the reply page. maskfields = password, zipcode |
|||||||||
| priority | This is used to set the X-Priority: mail header. If specified, it must be an integer in the range 1 to 5. The highest priority is 1. The value 1 is typically displayed as an exclamation mark by email clients. If a recipient is rejected, the priority is always set to 1 and the list of rejected recipients is appended to the body of the email. |
|||||||||
| subject | This is used to specify the subject of the email. | |||||||||
| ticket | This is used to create ticket numbers that are placed in the subject line of the resulting email. A filename must be specified. An initial value may also be specified following a comma. For security reasons, this parameter cannot be specified by url - it must be specified by file. e.g. ticket=bugs_geewhizz.ticket,1042will cause ticket numbers to be inserted into the subject. The counter value is stored in the file bugs_geewhizz.ticket The first number will be 1043. The 21st bug report might have the following subject line:- [#1063] GeeWhizz - bug report The suffix h may be used to issue hexadecimal tickets. e.g. ticket=comments.ticket,0h | |||||||||
| timeout | This is the maximum period, in seconds, for which the script
will wait for the smtp server to respond. This may be ignored on some systems. |
|||||||||
| verify | Generally the file parameter should be ! The the value 1 will cause verification of each recipient address to be requested. Typically, smtp servers respond with the status code 252 - verification not possible. If your server supports verification of addresses, you may find this useful in unusual situations. |
|||||||||
| csvfile NEW (v 1.5) |
This parameter must be specified by file, there is no corresponding url parameter. csvfile=formdata.csv |
|||||||||
| csvfields NEW (v 1.5) |
This parameter must be specified by file, there is no corresponding url parameter. It should consist of a comma-delimited list of field names corresponding with values in the form. If not specified, csvfile is ignored (and no data is recorded). Field names should not contain spaces. Field names are NOT case-sensitive. The following field names are reserved and should not be used in forms :-
e.g. csvfields=datetime, ticket, name, family-name, email, zip, phone, fax |
|||||||||
| csvoptions NEW (v 1.5) |
This parameter must be specified by file, there is no corresponding url parameter. linebreak:[character string] recordfieldnames:0/1 csvoptions=linebreak:" <{ ", recordfieldnames:0
e.g.
csvoptions=linebreak:\n, recordfieldnames:1 |
|||||||||
| result pages | For use only in unusual situations - perhaps confirming a
vote has been cast. You can change the style of the standard result page using the file uniformmail.css. |
|||||||||
| success | Url of success page. Generally, the file parameter should be ! to display default information. If specified, the url must include the http://..... etc. You may use * to represent the domain name. e.g. success=http://www.*/contact/mail-success.html |
|||||||||
| error | As success except this page is displayed if an error occurs. | |||||||||
Recording Data in a CSV File (comma-separated-value file)
NEW (v 1.5)
In addition to sending data by email, data can be recorded.
- Form data must be submitted by the POST method (not GET) i.e. the body parameter cannot be used.
- All fields are written on a single line, however, if a field contains a linebreak, it will wrap onto a second line unless the csvoptions value linebreak is specified.
- The filename must be specified using the csvfile parameter.
- Fields must be specified using the csvfields parameter.
Only specified fields are recorded. - As a minimum, both csvfile and csvfields must be specified otherwise all CSV instructions are ignored.
- If a field is blank, it is recorded as "", i.e. two double-quotes.
- If a field contains commas, semicolons, double-quotes or white space (including linebreaks) it is enclosed in double-quotes.
- If a field contains double-quotes, each will be escaped with another double-quote.
e.g.
ab c"de"f gh will be recorded as "ab c""de""f gh" but smith will be recorded as smith since it contains no whitespace or special characters.
Copying to the Sender (creating a receipt)
NEW (v 1.5)
In addition to sending submitted form data to company email addresses, etc. and recording data in a csv file, you can also send a receipt to the person that submitted the data (assuming they provide you with a valid email address). This requires additional parameters that can only be specified by file. The parameter names are generally the same as those above but are prefixed by copy. or copy_
- copy_xxx specifies a new but equivalent constant value.
- copy.xxx refers to a variable value, i.e. a submitted data field.
If copy.xxx and copy_xxx are both specified the copy.xxx takes precedence but is ignored if the resulting value is null (i.e. the field is empty or missing).
If no valid copy value is specified, a default is taken from the standard equivalent value. - copy.to should normally refer to a clean email address, i.e. without a display name.
- copy.name should refer to the display name to which email will be sent.
copy.name must be blank if the field identified by copy.to is likely to contain a display name. - The following parameters are currently recognised :-
copy.to, copy.name, copy.subject, copy.enable, copy_return, copy_from, copy_subject, copy_replyto, copy_mask, copy_body - As a minimum, copy.to must be specified otherwise no receipt is sent.
If specified, copy.send should be the name of a checkbox requesting a receipt.
e.g.copy.to = user_email # field name specified in form (required) copy.name = user_name # field name specified in form (optional) copy.subject = # field name specified in form copy.send = want_receipt # field name of checkbox requesting receipt copy_return = mailerrors@geewhizz.com # constant value : MUST NOT CONTAIN QUOTED DISPLAY NAME copy_subject = Confirmation of enquiry # constant value copy_from = Geewhizz Inc # constant value. If address is omitted, copy_replyto is used. copy_replyto = no-reply@geewhizz.com # constant value copy_mask = 1 # apply maskfields value to receipt copy_body = Thank you for your enquiry.\nThe following information has been sent to our sales dept.+ # If copy_body is omitted only submitted data is sent. # If copy_body ends with a '+' submitted data is appended beginning with a new line. # In copy_body linebreaks are represented by '\n' but '\' should NOT be encoded as '\\' # but simply written as '\'.
- Although is is normally fine to use a null return address for internal mail, when sending mail to users, a valid return address can be essential to avoid avoid being wrongly identified as spam.
- Since some spam filters reject all mail that is not white-listed by the user (or require a captcha form to be completed by the sender) it is advisable to provide sufficient information on the form for the user to white-list your company/organisation.
Encoding Special Characters
Certain characters are not permitted in, or have special meaning in, urls and html - such characters must be encoded.
- In html, characters are encoded as sequences beginning with `&´ and ending with `;´ e.g. "
- In urls, characters are hex-encoded with % as a prefix e.g. %20 represents [space].
- The & character is permitted in urls but not in html. Therefore, when written in html, it must be encoded as &
- When constructing urls with javascript, the & character MUST NOT be encoded as &
- When constructing urls with html, both encoding methods may be permissable but the %hh method is recommended.
- The javascript function escape() may be used to perform url-encoding.
The following table summarizes the encoding likely to be required when constructing urls for Uniform Mail.
| HTML | Javascript | |
| & | & | & |
| space | %20 | %20 |
| " | %22 or " | %22 or " |
| > | %3E or > | %3E or > |
| < | %3C or < | %3C or < |
Examples
action="/cgi-bin/formmail/uniformmail.pl?from="form mail"<formmail@domain.com>&debug=1"may be encoded for HTML as (<form> action)
action="/cgi-bin/formmail/uniformmail.pl?from="form%20mail"<formmail@domain.com>&debug=1"or for Javascript as
action="/cgi-bin/formmail/uniformmail.pl?from=%22form%20mail%22<formmail@domain.com>&debug=1"
- Only the parameter part of the url (following the `?´ character) should be encoded.
- When the form action is set using javascript, simple url-encoding of the parameters is required - use the escape() function.