Uniform Mail : Parameter Reference

Notes


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.
If specified, this value is inserted in the result page as a meta tag, otherwise, it has no effect.
Generally, it should match the value equivalent value of the form page (or its http header).
No default is specified, partly for backward compatibilty and partly to avoid potential conflicts with server defaults.
Generally, the use of UTF-8 is recommended for all languages.

This value can be specified in the csvfields list to ensure character encoding is saved with other field data.
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.
Names are not case-sensitive and should be separated by commas.
Unless copy_mask = 1, this has no effect on the receipt if one is sent.

e.g.
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,1042
will 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.
It should consist of a filename only.

e.g.
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 :-
datetime :  represents the time when the form data was submitted.
charset :  represents the character set used as speciified by the charset parameter.
ticket :  represents the ticket number, if any.

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.
Currently, two options may be specified being linebreak and recordfieldnames.
If an option value contains spaces or commas, it must be wrapped in double-quotes.
The name and value are separated by the colon character NOT the equals character.
Option names are NOT case-sensitive.

linebreak:[character string]
If specified, linebreaks are replaced by the specified character string.
If not specified, values that contain linebreaks are wrapped in quotes and extend over multiple lines.
linebreak=\n is treated as a special case. In addition to encoding linebreaks as '\n' all occurences of '\' are replaced by '\\'.

recordfieldnames:0/1
0 : fieldnames are not recorded in the csv file.
1 : default - field names are recorded on the first line when the file is first created.

e.g.
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.

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_

Encoding Special Characters

Certain characters are not permitted in, or have special meaning in, urls and html - such characters must be encoded.

The following table summarizes the encoding likely to be required when constructing urls for Uniform Mail.

  HTML Javascript
& &amp; &
space %20 %20
" %22 or &quot; %22 or "
> %3E or &gt; %3E or >
< %3C or &lt; %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=&quot;form%20mail&quot;&lt;formmail@domain.com&gt;&amp;debug=1"
or for Javascript as
action="/cgi-bin/formmail/uniformmail.pl?from=%22form%20mail%22<formmail@domain.com>&debug=1"