Formmailer Form Processor V5 will be available soon, and compatible with new PHP versions!

Formmailer Form Processor Documentation

The new Formmailer Form Processor V5 is close to arrival! Some features have been added, or made easier, a couple was tossed because they weren’t used or had a negative impact on performance for a very minimal user base that actually used it.

The previous Formmailer Form Processor was very popular and well received, and supported by users. Because of my own life schedule I sadly let it fall too far out of date and depending on the features used by the users started having problems with PHP 7 and beyond. However this new version will address those issues.

I am hoping this newest version is as well received as the previous was back in it’s day! For the forseeable future I will leave the previous version available for those that it works for, or they prefer it for their own reasons.

Notable Changes

There are a few things worth noting that are different in this latest version.

  • Fewer configuration variables…the last version became very bloated with configuration options. This version is much less due to better streamlining of the options, elimination of some unused or very seldomly used, features. Still very fully functional and reliable, just hopefully easier to configure and use.
  • Mail sends via an SMTP server, no longer using PHP’s built in mail functions. This provides additional security, plus PHP’s version is mixed support from host to host due to known security and unpredictability of those features. There are many, many free SMTP services available for use if you don’t already have one.
  • Anti-spam features are integrated from my Anti-Spam Forms project. Though these features were available in the previous version, theyare now slimmed down and removed the CAPTCHA option, since the honeypot and submission timer options have been found to be quite reliable. The best part of them is that they work great together, and neither interferes with the user experience like CAPTCHA does.
  • If flagged as spam it can be set to never hit the SMTP server in order to save usage limits that are often placed on free SMTP services.

Formmailer Form Processor V5 Script Structure and Installation

The script contains two directories; “class” and “attachments”. “class” contains two object oriented classes, one for Formmailer to do it’s work in catching the form contents, check for spam, cleanse the data and format it. The other is a 3rd party script I implemented that takes the information and actually sending the email.

Above that level are a few files. One is formmailer.php, which is the script forms are submitted to, results.php is what creates the “thank you” and “error” pages. Form.php is a sample form for users to use as a template to create their own.

It is recommended you keep this structure unless you know what you are doing and know how to adjust the script accordingly. This is because if files are moved around you could break the relationship between them.

General Variables

These variables are set once, not one for each form being used, because they are global options. They are at the very top of the configuration file. The variable values will apply to every form configuration.

$referring_domainsA comma separated list of the domains that are allowed to submit to Formmailer. If left empty it will simply allow any other system to submit to your script.
$smtp_serverThe server name of your SMTP server.
$smtp_portThe port of your SMTP server.
$smtp_protocolValues = SSL, TLS, None
The type of security your SMTP server uses.
$smtp_authValues = 1 for yes, 0 for no
Whether or not your SMTP server requires authentication (1 should be typical).
$smtp_usernameUsername of your SMTP server authentication.
$smtp_passwordPassword of your SMTP server authentication.

Individual Form Configuration Options

Recipient Info

$charset[0]Defaults to UTF-8, but you can use any character set you may need.
$tomail[0]Who the form results get sent to. Comma separated list if multiple people.
$cc_tomail[0]Who the form results get CC’d to. Comma separated list if multiple people.
$bcc_tomail[0]Who the form results get Bcc’d to. Comma separated list if multiple people.

Anti-Spam Options

$flag_spam[0]Values = 1 for yes, 0 for no
Sends the email, but flags the subject line as spam.
$minimum_time[0]Value = integer (indicates seconds)
The minimum amount of time to fill out the form, if it’s less than that, it’s flagged as auto-bot spam
$honeypot_name[0]Value = field name
The name of the field being used as a hidden checkbox (known as a honeypot). If that field is actually checked, it is flagged as auto-bot spam.

Error/Success Page Variables

$error_page_title[0]The title text of a resulting error page using Formmailer’s standard results page.
$error_page_text[0]The body text of a resulting error page using Formmailer’s standard results page.
$thanks_page_title[0]The title text of a resulting thank you page using Formmailer’s standard results page.
$thanks_page_text[0]The body text of a resulting thank you page using Formmailer’s standard results page.
$error_page[0]If you wish to use your own custom error page, add the path to the custom page. If you use the the above title and text to use the standard error page, leave this empty.
$thanks_page[0]If you wish to use your own custom thank you page, add the path to the custom page. If you use the the above title and text to use the standard thank you page, leave this empty.

Mail Content and Layout Options

$mail_format[0]Values = horz_table, vert_table, text
How you want the results sent to you. Horizontal or vertical table or plain text.
$mail_fields[0]Comma separated list of the fields you want in the email.
$mail_intro[0]Any introductory text you may want to prepend the results.
$return_ip[0]Values = 1 for yes, 0 for no.
Whether or not to send the IP address of the sender along with the results.
$subject_field[0]The name of the form field that you want to be used as the subject of the email.
$reply_to_field[0]The field used as the email address of the sender.
$reply_to_name[0]The field used as the name of the sender.
$required_fields[0]Comma separated list of the filds that are required.
$required_email_fields[0]Comma separated list of the fields that should be validated as proper email addresses.
$attachment_fields[0]Comma separated list of fields that contain file attachments.