Welcome to Dagon Design. In addition to free scripts, WordPress plugins, and articles, we offer a variety of services including custom theme design, plugin creation, and PHP scripting. Contact me for more information.

Version 5.8   Updated Sunday, July 5th, 2009 at 8:20pm

Secure PHP Form Mailer Script

This is the PHP version of my secure form mailer script. This script has a wide range of features including: an easy to use dynamic form generation system (any number of fields, in any order), multiple recipients, multiple file attachments, optional auto reply feature, an image verification system, numerous security features (including protection against email header injection), a message template system, multiple languages, and too many other things to list. This script was designed to be easy to use, while still being extremely flexible. If you just want a simple contact form, you can set one up with just a few clicks. For those of you who need something a bit more advanced, you can completely customize script plugin to fit your needs – whether it is 5 fields or 500. A WordPress plugin version is also available. ReCaptcha support has also been added, as well as support for storing the data in a delimited file.

You can see a very basic implementation of the WordPress plugin version of this script on this site’s contact page.

Notice: WordPress Users

Information on the WordPress plugin version of this script

Languages

As of the latest release, this script contains language files for:

English, Belarussian, Brazilian Portuguese, Catalan, Czech, Danish, Dutch, Estonian, Finnish, French, German, Greek, Italian, Japanese, Norwegian Bokmaal, Polish, Portuguese, Romanian, Russian, Slovak, Slovene, Spanish, Swedish, Turkish, Vietnamese

If you would like to submit a language file please contact me.

WordPress vs PHP Versions

To make things easier to find, the two versions of this script share much of the same documentation. While the basic features are the same, there are several differences, so be sure to reference the proper page.

Table of Contents

Due to the size of this page, I have split everything up into sections:



Download

  If you have found this page useful, please consider donating. Thanks!



Changelog

Since both the WordPress and non-WordPress versions of this script are updated together, the changelog below reflects both versions.

  • 07-05-09 – v5.8 Added Estonian language. Added code to check for duplicate field names. Can now use commas in checkbox descs. Fixed garbled auto-reply messages. Adjusted the displaying of uploaded file names in the email message. mb_encode_mimeheader error in WP fixed. Other adjustments to email headers. Added ‘id’ declaration to select boxes. Fixed incorrect example code in the instructions. Other minor changes.
  • 02-22-09 – v5.7 Fixed issues regarding the saving of attached files, data selection values not being recorded, and various minor fixes. Inline styles have been removed from the two field items that contained them.
  • 10-19-08 – v5.6 Added javascript date chooser field. Added html code field. Adjustments for better character set support. Fixed bug with spaces in selrecip. Commas can now be used in check boxes, radio buttons, and select boxes (see field info below). Timestamp option added for saving to data file. New email validation code (from http://code.google.com/p/php-email-address-validation/). New language added: Vietnamese
  • 09-18-08 – v5.51 Captcha now displays properly in Safari and Chrome. All of the auto-reply issues should now be resolved. Few changes to headers for compatibility.
  • 08-24-08 – v5.5 Fixed various undefined index errors, code changes to improve xhtml validity, attachments can now be saved to the server (not just emailed), improved email header handling for language support, can now show url (of form) in message, fixed issue with required select boxes, added Belarussian, Czech, and Japanese languages, clickable labels for radio and checkbox items, and various other fixes.
  • 05-13-08 – v5.41 Added support for saving form data to a delimited file. Fixed a few issues including the loading of recaptcha files, and attachment support.
  • 11-25-07 – v5.4 Added support for ReCaptcha, manual form code entry, 5 new languages (Catalan, Danish, Polish, Romanian, and Turkisk), several html and css tweaks, and other misc. updates.
  • 07-27-07 v5.33 – Few minor bugs fixed. Finnish language file added.
  • 07-08-07 v5.32 – Error messages affecting form alignment issue resolved. Italian and Slovak language files added.
  • 06-18-07 v5.3 – ‘undefined index’ errors fixed, image verification adjustments, p tags removed from fieldsets, changes to help html validity, various other fixes.
  • 05-09-07 v5.25 – ‘Thank you’ message now allows for form field inputs as well.
  • 05-08-07 v5.24 – Auto-reply message now allows for form field inputs. Language selection issue resolved. str_replace errors (on certain servers) fixed. Norwegian BokmÃ¥l language file added.
  • 05-01-07 – Not a version update. Greek and Swedish language files added.
  • 04-18-07 v5.23 – Renamed email verification function (to fix conflicts with other scripts). The GD check is now disabled if you are not using image verification. Added two new language files – Portuguese and Russian.
  • 04-18-07 – Not a version update. Brazilian Portuguese language file has been added.
  • 04-03-07 v5.22 – Email generation code has been modified to try to work with more servers. French language file has also been updated.
  • 03-28-07 v5.21 – Highly recommended update – Fixed an issue with the verification code not being handled properly. Nothing else has been changed.
  • 03-25-07 v5.2 – Email generation improved – should work better in more email clients. Many issues with message generation and field types have been fixed. Better support added for field requirement options. CSS for various fields updated. Issue with submit button fixed. Dutch and French language files added. Checkbox and drop-down issues resolved. Email verification method improved. Undefined index errors fixed, and much more. Be sure to read the updated instructions for the field types.
  • 03-13-07 v5.1 – Lots of updates: Slash escaping has been improved, p tags are now added around form elements, each form instance can have its own language setting, the language selection issue has been fixed, improved foreign character support in messages, check box handling improved, and a new optional auto reply feature has been added.
  • 02-06-07 v5.0 – This is a major update from version 4, and because of this, I have completely re-written this page, and removed the old changelog to save space.


Installation

  • 1) Download and uncompress dd-formmailer.zip
  • 2) Upload the entire dd-formmailer directory to your server
  • 4) Configure your options (explained below)
  • 5) Add the form to your page (explained below)


Required Configuration

While this script is highly configurable, some of you may just want to get up and running quickly with a simple (and secure) contact form. If so, these are the minimum options you need to configure within the file:

Standalone Option

$standalone – If you plan to use this script by itself (not included from another PHP file), set this option to TRUE, and it will generate a proper html header and footer. If you want to change the basic header and footer, they are found near the bottom of this script.

Path to CSS

$path_to_css – If you are using the standalone option, enter the relative path to your CSS file so it can be declared properly in the header. For those of you including this script in another PHP file, be sure to manually add the CSS declaration in the header section of your page, like this:

<link rel="stylesheet" href="(path to dd-formmailer.css)" type="text/css" media="screen" />

If you plan to use the javascript date field, you will also have to include the following line:

<script type="text/javascript" src="(location of date_chooser.js)"></script>

Language Setting

$language – The relative path to the language file you want to use.

Full URL to Script

$script_path – The full URL to dd-formmailer.php (or whatever you have renamed it to)

Full URL to Contact Page

$path_contact_page – If you are running this script in standalone mode, leave this blank. Otherwise, enter the full URL to the page that is displaying the form

Recipient Data

$recipients – If you are just sending email to a single address, enter it here. For more advanced usage such as multiple recipients, CC, BCC, etc.. more information is below

The other settings are optional, and are explained below.



Other Configuration Options

This is a listing of the other configurable options in the script. These are optional, but allow for much greater customization

Form Structure – This is where you define the fields that will be used on this form. There are a lot of options available for this, and they will be explained further down as well

Manual Form Code – This is a very advanced option that has its own section on this page.

Wrap messages – This option wraps message lines to 70 characters to comply with RFC specifications

Save attachments – If enabled, attached files will be saved to a directory on the server instead of attached to the email.

Save attachment path – Where files will be saved, if attach_save is enabled. This is the full path on the server, with a trailing slash. Directory must have write permissions. Example: /home/user/public_html/uploads/

Show required – If enabled, required fields will be marked with an asterisk

Show URL – If enabled, the URL the script is running from will be added to the message

Show IP and Hostname – If enabled, the visitor’s IP and hostname are added to the message

Special Fields – Sender name, Sender email, and Email subject – These options help generate the email headers. If you enter a field name, it will be replaced by user input from that field. For example, if you have a form field called fm_name and you use that as the Sender name option, the visitor’s name will be used as the From field in the email. You can also combine them. If you have a field called fm_firstname and fm_lastname you could enter ‘fm_lastname, fm_firstname’ – For the Sender email option, just use your email field

Max upload size – This allows you to set the maximum file size (in bytes) for attachment uploads. This option only applies if the setting is lower than the value already set in your php.ini file

Message Structure – This feature is optional. If left blank, the script will generate the email message itself, which will include all the data the visitor submits. If you choose to use this option, it will act as the message template. Simply enter your custom text, including your field names. When the message is generated, the field names will be replaced by the user input from those fields. Note: Since the script will just do a search and replace for field names, be sure they are unique enough. Example: A check for fm_message2 would also get triggered by fm_message when the script adds in the input.

Success Message – This is the text that is shown after the email has been sent. You can also use field names in this, and the user input from those fields will be used to generate the message.

Auto Reply – This is an optional feature that allows you to automatically send a pre-defined message back to those who contact you. More information on this is below

Image Verification Method – There are three choices for image verification. It can be disabled, you can use the script’s built-in system (a simple captcha – requires GD support on the server), or you can use the ReCaptcha system (requires signing up for a free account at recaptcha.net)

Basic Method Options – If using the basic image verification method, you can choose the text and background color for the image (3 or 6 digit hex codes). By default, the script will try and choose the best file format for the verification image, but if it gives you any problems, you can manually specify the format to see what works best for your server.

ReCaptcha Method Options – If using the ReCaptcha image verification method, you must enter the public and private keys given to you at the ReCaptcha website. These are used to generate the verification form, and the keys are specific to the website under your account (meaning if you use this script on multiple sites, you need a set of keys for each).

Save Data to File – When enabled, the form input will be saved to a delimited file.

Still Send Email – When using the delimited file feature, this option determines whether or not the script still sends the email.

Data Path – The path to the file the data will be written to – relative to the script’s directory. Be sure to give this file write access.

Delimiter – Fields will be separated by this character. If this character is found in the actual data, it will be removed for simplicity.

Newlines – Newlines in input, such as text areas, will be replaced by this, to keep the data on a single line in the file.

Timestamp – Adds the date/time to the beginning of each line in your data file. This uses the PHP date format. Leave blank to disable.



Other Customizations

With the exception of the text defined in the options, all text visible to the visitor is contained within the language file.

Visual changes to the form can be made in the included CSS file. The class names used in the examples below already exist within the CSS.



Usage

If you are using the standalone option, all you have to do is open the URL to the script file in your browser.

If you are not using the standalone option, you can include the script in your existing PHP file with the following code:

<?php include('dd-formmailer.php'); ?>

Be sure to use the relative path to the script file.



Advanced Recipient Options

As mentioned above, if you want to send the messages to a single recipient, just enter the email address in the recipients option. To send to multiple recipients, separate the addresses with a | (pipe) character, and use one of the following prefixes for each: to= cc= bcc=

Examples:

to=user1@domain.com|to=user2@domain.com
to=user1@domain.com|cc=user2@domain.com
to=user1@domain.com|cc=user2@domain.com|bcc=user3@domain.com

You can have as many of each type (to, cc, bcc) as you like, and they can be in any order, although the first one in the list is the always the primary recipient, and must use to=

For those of you who want to let the vistor choose the recipient from a drop-down box, first you must enter selrecip in the recipients field. Then you must add a new line in the form structure box. Example:

type=selrecip|class=fmselect|label=Recipient|data=(select),
User1,user1@domain.com,User2,user2@domain.com

The type must be selrecip, but you can use whatever you like as the CSS class, and label. The first item in the data parameter is the default (unselected) option. After that are the names and email addresses. You can add in as many as you like – just keep them in the proper order (name,email,name,email,etc..). Only the names are visible within the HTML for privacy reasons.

The ‘(select)’ item is the default selection, which the user must change to submit the form. You can change the ‘(select)’ text if you choose.



Advanced Form Structure

This script uses a dynamic form generation system, which means that by simply adding a new line to the form structure, you will have a new field in your form. You can have as many fields as you like, and in any order. The only field type that you must absolutely have is the verify field if you are using the image verification option. All of the fields are explained below, with examples. Separate each field type with a single newline in the form structure option. (Some of the examples below are bit long, so they are wrapped to the next line – be sure that the only newlines are after each field type when adding them to your form structure.)

These are the different parameters that apply to most of the field types (Special exceptions and parameters unique to a particular field are listed under each field type):

  • type – This tells the script what type of field you are adding.
  • class – The CSS class used to style the field. The classes used in the examples below already exist in the CSS file.
  • label – Text that is shown next to the field.
  • fieldname – The name of the form field (must be unique).
  • max – Maximum number of characters allowed.
  • req – (OPTIONAL) If you want to require a field, set this to true. If not, do not add it.
  • default – (OPTIONAL) This allows you to specify the default value of a field.

TEXT

This is a standard text input field.

type=text|class=|label=|fieldname=|max=|[req=true]|[ver=]|[default=]

The text field type has a special parameter – ver – which can be used to verify the input. You can choose email (which checks that the input is a proper email address) or url (which checks that the input is not only a proper URL, but that it actually exists). If you do not want to use either validation option, do not add this parameter.

Examples:

type=text|class=fmtext|label=Name|fieldname=fm_name|max=100|req=true 

type=text|class=fmtext|label=Age|fieldname=fm_age|max=100|
default=Enter your age! 

type=text|class=fmtext|label=Email|fieldname=fm_email|max=100|req=true|
ver=email 

type=text|class=fmtext|label=URL|fieldname=fm_url|max=100|ver=url

DATE

This is a javascript pop-up date chooser.

type=date|class=|label=|fieldname=|[req=true]

This field type generates a text box with a calendar icon next to it. The user can enter a date manually, or click on the icon to see a small calendar that they can choose a date from.

To change this image, just replace calendar.gif in the script directory. Either give your file the same name, or search and replace the name in the script file.

Example:

type=date|class=fmdate|label=Event Date|fieldname=fm_date|req=true 

HTML

This field type lets you insert html, or other code, anywhere in your form.

type=html|text=

Example:

type=html|text=<p>Hello!</p> 

PASSWORD

This is a standard password field. It is exactly like a text field, except it shows asterisks when the user types.

type=password|class=|label=|fieldname=|max=|[req=true]|[confirm=true]

The password field type also has a special parameter – confirm – which if set to true, it duplicates the password field, so that the visitor has to confirm their input. If you do not want to use this, do not add the confirm parameter.

Examples:

type=password|class=fmtext|label=Password|fieldname=fm_pass|max=100|
req=true|confirm=true
 
type=password|class=fmtext|label=Secret Word|fieldname=fm_secret|max=100

TEXTAREA

This is a standard text area, for multiple lines of text.

type=textarea|class=|label=|fieldname=|max=|rows=|[req=true]|[default=]

The textarea field type has a special parameter – rows which defines the number of rows in the field (required for valid html).

Examples:

type=textarea|class=fmtextarea|label=Message|fieldname=fm_message|
max=1000|rows=6
 
type=textarea|class=fmtextarea|label=Message|fieldname=fm_message|max=1000|
rows=4|req=true
 
type=textarea|class=fmtextarea|label=Message|fieldname=fm_message|max=1000|
rows=10|req=true|default=Type here!

WIDETEXTAREA

This is exactly the same as the standard textarea, except that it’s wider, and the label is above it instead of to the side.

type=widetextarea|class=|label=|fieldname=|max=|rows=|[req=true]|[default=]

Example:

type=widetextarea|class=fmtextwide|label=Message|fieldname=fm_message|
max=1000|rows=10|req=true

* Note that the normal textarea, and wide textarea fields use a different CSS class for formatting.


VERIFY

This field is required if you are using the basic verification method. It does not apply if you are using the ReCaptcha method. It is used for placement of the verification image (and associated text box) in the form.

type=verify|class=|label=

Example:

type=verify|class=fmverify|label=Verify

FULLBLOCK and HALFBLOCK

These are not standard form fields, but simply a way you can add text to your form. The full block is as wide as a wide textarea, while the half block is aligned with other standard fields. You can use basic HTML in your text if you like.

type=fullblock|class=|text=
type=halfblock|class=|text=

Examples:

type=fullblock|class=fmfullblock|text=This could be some sort of 
introduction message.
 
type=halfblock|class=fmhalfblock|text=This could be used to explain a field 
in greater depth.

OPENFIELDSET and CLOSEFIELDSET

These do just what the name implies – they open and close a fieldset in your form so you can help group fields together. It also allows you to specify a legend for the fieldset (required for valid HTML).

type=openfieldset|legend=
type=closefieldset

Examples:

type=openfieldset|legend=Your Information
 
(other field would go between these)
 
type=closefieldset

CHECKBOX

The checkbox field can be used to generate a single checkbox, or a group of them. The usage is a bit different than the other fields.

type=checkbox|class=|label=|data=
(fieldname),(text),(checked),(REQUIRED),
(fieldname),(text),(CHECKED),(REQUIRED)...

As you can see, the checkbox data is a comma separated list of four items per checkbox:

  • fieldname – A unique fieldname for each checkbox in the form.
  • text – The text shown to the right of each checkbox.
  • checkedtrue or false. This allows you to make checkboxes checked by default.
  • requiredtrue or false. If true, it means that the user must check the box to send the message. Mainly useful for ‘check here to agree’ type situations.

*NOTE* Because this field type uses commas to separate data, if you would like a comma to be displayed in your data, simply use two. It will be replaced later in the code.

Examples

type=checkbox|class=fmcheck|label=I Agree|data=fm_agree,I agree to the 
terms,false,true
 
type=checkbox|class=fmcheck|label=Interests|data=fm_i1,Computers,false,
false,fm_i2,Art,false,false,fm_i3,Music,false,false

RADIO

This field generates a group of radio buttons. Radio buttons are similar to checkboxes, except that they are treated as a group, and only one option may be selected.

type=radio|class=|label=|fieldname=|[req=true]|[default=]|data=(text),(text),
(text)...

The req and default items are optional. req, if set to true, makes the field required. default can be set to the option number you want to be selected by default (starting at 1).

*NOTE* Because this field type uses commas to separate data, if you would like a comma to be displayed in your data, simply use two. It will be replaced later in the code.

Examples:

type=radio|class=fmradio|label=Gender|fieldname=fm_gender|data=Male,Female
 
type=radio|class=fmradio|label=Color|fieldname=fm_color|req=true|default=1|
data=Unspecified,Red,Green,Blue

SELECT

The select field generates either a standard drop-down box, or a multi-select box, depending on the multi option. Option groups are supported as well.

type=select|class=|label=|fieldname=|[multi=true]|[req=true]|data=(#group),
(text),(text),(#group),(text)...

The multi and req options are optional.

If the field is required, the first option you have in the data paramater will be the default, which tells the user they need to select one of the options. If they do not change the default option, and it is required, they will receive an error.

The data field is just a list of the options, separated by a comma. To define the start of an option group, just prefix the group name with a # as shown below.

*NOTE* Because this field type uses commas to separate data, if you would like a comma to be displayed in your data, simply use two. It will be replaced later in the code.

Examples:

type=select|class=fmselect|label=Age|fieldname=fm_age|req=true|
data=(select),0-30,31-60,61-90,91-120
 
type=select|class=fmselect|label=Colors|fieldname=fm_colors|
multi=true|req=true|data=Red,Green,Blue
 
type=select|class=fmselect|label=Choose|fieldname=fm_choose|
data=#Category1,item1,item2,#Category2,item3,item4

FILE

The file field generates a file upload box. As with all other fields, you can add as many of these as you like, as this script supports not only attachments, but multiple attachments. The only thing to keep in mind is that you may need to find out the limit your server has set for file upload sizes.

type=file|class=|label=|fieldname=|[req=true]|[allowed=1,2,3]

The allowed field is optional, and lets you define a (comma separated) list of file extensions that are allowed to be uploaded. Otherwise, all file types will be allowed.

Examples:

type=file|class=fmfile|label=Upload|fieldname=fm_upload
 
type=file|class=fmfile|label=Upload|fieldname=fm_upload|req=true|
allowed=jpg,jpeg,gif,png


Manual Form Code

This feature allows you to manually specify the code used to generate your form. By default, this script uses the form structure information to dynamically generate the form. While this makes it easier for most people, since they do not have to write any code, it can limit those who need a bit more flexibility in their form structure.

Important Notice: Because this method means you will be writing the form code yourself, and it will not be generated by the script, there is no way for it to automatically insert the PHP code needed to put the user’s input back into the form when there is a validation error. It is just not possible for this to be done automatically due to the nature of the option. The only way this can be accomplished is if you know enough about PHP to insert the code manually yourself. In other words, this is a very advanced option – only for those who are very familiar with HTML forms and PHP.

  • 1) Customize your form using the ‘Form Structure’ option as you would normally – this is required even when using the manual code entry, as it allows for processing of the form.
  • 2) Be sure you have all your options exactly as you want them, and view your newly created form page.
  • 3) View the source of the page, so you can copy the generated html. The code you need is between the following lines:
    <!-- START of Dagon Design Formmailer output -->
    <!-- END of Dagon Design Formmailer output -->
  • 4) You can now customize this form code however you like, as long as the core elements of the form and fields are still in place.
  • 5) Enter your new code into the ‘Manual Form Code’ option. (PHP VERSION NOTICE: Depending on your form code, you may have to ‘escape’ single or double quotes, as you are assigning this code as a string value to the $manual_form_code option!)
  • 6) If everything worked properly, your page will now use the custom form code. Once again, the standard form structure option is still required, as it is still for processing of the form.

You can also adjust the included CSS file to better fit your needs, or completely clear it out and manually create an entire new CSS structure for your task. Keep in mind that if you change any field items (or any options which affect the form code generation), you will have to repeat this process.

To disable the manual form code feature, just clear out the option for it.



Auto Reply Feature

The options page for each instance includes fields to define an auto reply message. This is a pre-defined message that is sent back to the visitor.

To use this option, simply enter the name, email address, subject line, and message for your auto response. To disable this feature, just leave the message field blank.

You can also use field names in the auto reply message, and the user input from those fields will be used to generate the message.



Saving Data to a File

This option allows you to save the form input in a delimited file. Please see above for a full explanation of the options.

With the PHP version of this script, the path to the data file is relative to the location of the script. Be sure to give this file write access.



Other modifications

Redirect after form submission – Method 1

It is possible to use Javascript to redirect the user after the form has been filled out. While this method is not 100% valid (Javascript redirection should go in the HEAD section of the page), it works. To add this feature, first find the following line in the script:

$o .= $sent_message;

And replace it with this:

$o .= '<script><!-- 
window.location= "http://www.mysite.com/" 
//--></script>';

(where mysite.com is the URL you want to redirect to)

Redirect after form submission – Method 2

This is another method you can use to redirect the user after the form has been submitted. First, find this line:

$o .= $sent_message;

And after it, add this:

$o .= '<META HTTP-EQUIV="REFRESH" CONTENT="4;URL=http://www.mysite.com/">';

Where ‘4′ is the number of seconds to wait before refresh, and the ‘http://www.mysite.com/’ is the URL you want to redirect to.

Passing values to the form

To allow values to be passed directly to the form, all you have to do is change all references of $_POST to $_REQUEST (The REQUEST superglobal contains the values of both POST and GET items)

Prevent form data from being resubmitted upon refresh

This feature is included in the WordPress plugin version, but not in the PHP version, because of how it has to be used. To enable the feature when using the script in standalone mode, add the following code after the PHP declaration at the top of the script:

if (count($_POST) > 0) {
  $lastpost = isset($_COOKIE['lastpost']) ? $_COOKIE['lastpost'] : '';
  if ($lastpost != md5(serialize($_POST))) {
    setcookie('lastpost', md5(serialize($_POST)));
    $_POST['_REPEATED'] = 0;
  } else {
    $_POST['_REPEATED'] = 1;
  }
}

If you are not using the standalone option, you must add that code at the very top of the PHP file you are calling the script from. Add PHP tags around it if needed. Just make sure there is no extra whitespace around the PHP tags.

Modifying the script to use HII for image verification

Miro has posted instructions for users wanting to use HII: Read the comment. Notice: Modifications listed in the comments may not apply for new versions of the script.

Using SELRECIP and BCC together

The easiest way to do this, is to find the following line in the script:

$send_status = mail($send_to, $email_subject, $msg, $headers);

If you are using SELRECIP, the message will be sent to whoever the visitor chooses. If you would also like the message to go to someone else, no matter who is chosen, just duplicate that line like so, adding in the address of the secondary recipient:

$send_status = mail("user2@domain.com", $email_subject, $msg, $headers);



Troubleshooting

Fields not working properly/Form is not displaying properly

As stated above, each field item needs to be on a single line in your form structure. Many of the examples above are long, so they do not show up on a single line. Be sure to remove any linebreaks when adding them to your form. One form field statement per line.

Verification image not showing up

The first thing to do is check to make sure your paths are set correctly in the options.

This script automatically chooses the best file type to generate the verification image. If your verification image is not displaying, the problem could be that your server will not properly generate that type of file. You can manually set this using the ‘Force image type’ option in the script. It allows you to manually specify jpeg, gif, or png.

Try all the options to see which works best for you.

Problems sending email

The most common question I receive is ‘Why am I not receiving email from the script?’

There are many reasons this can happen. The first thing to do is make sure you have access to the PHP mail function on your web server, and that there are no restrictions in place that might prevent certain features of this script from working. If you are not sure, please ask your host for information. Unfortunately, I am not able to spend the time troubleshooting general server issues for everyone.

Also try having the script send the messages to another email address (on another domain), just to be sure the problem is not with your email account.

If you believe you can use the PHP mail function and have already tried a different email address, create a small PHP file with the following contents (be sure to use your own email address):

<?php mail('you@domain.com', 'test subject', 'test message'); ?>

Open the file in your browser and then check your mail. If you did not receive the message, something is not set properly on your server, and the trouble is not with this script. Even if other mail scripts work for you, that does not mean this one will, as there are several methods to send mail in PHP.

If you do receive the message, it most likely means that your server is configured to not allow the use of the fourth parameter (extra headers) in the mail() function. To work around this, replace this line:

$send_status = mail($send_to, $email_subject, $msg, $headers);

With this:

$send_status = mail($send_to, $email_subject, $msg);

The only downside is that certain features (such as some header information, and the ability to send to multiple recipients) will be disabled. You may be able to contact your host and have them change this though. Many hosts add in this restriction for security reasons, to protect against unsafe scripts.

Lastly, some servers require an extra parameter for the mail function that specifies who the message is from. In many cases, this must be an email address on the server itself. Example:

$send_status = mail($send_to, $email_subject, $msg, $headers, '-f user@domain.com');

‘Headers already sent’ error

Another common question is the ‘headers already sent’ error message. Without getting into the details, this generally happens when something is output to the browser before a call to set_cookie, header, or a number of other PHP functions. Be sure there is no extra whitespace at the top of your file.

Mail headers showing up in message body / attachments not working

This issue can be caused if your server does not like the return/newline character set being used to end lines of the email headers. If you are experiencing this problem, try changing this line:

if (!defined('PHP_EOL')) define ('PHP_EOL', strtoupper(substr(PHP_OS,0,3) == 'WIN') ? "\r\n" : "\n");

To this:

if (!defined('PHP_EOL')) define ('PHP_EOL', strtoupper(substr(PHP_OS,0,3) == 'WIN') ? "\n" : "\n");

If you require special SMTP settings for mail to be sent

If you have to manually specify the SMTP settings, you can do so with the following code. This is only recommended for advanced users.

ini_set("SMTP","mail.MYDOMAIN.com");
ini_set("smtp_port","587");
ini_set("username","MYUSERNAME@MYDOMAIN.com");
ini_set("password","MYPASSWORD"); 
ini_set('sendmail_from', $sender_email);
$send_status = mail($send_to, $email_subject, $msg, $headers);
ini_restore('sendmail_from');

(Just search for the reference to the mail() function to see where to add it)

Conclusion

Please be sure to read the entire article before asking a question. I spend a lot of time on the scripts and plugins available on this site, and it can be hard to keep up with all the requests. If you need modifications or a custom version, please contact me. Thanks for reading!

  1. This article gives the light in which we can observe the reality.
    This is very nice one and gives indepth information. Thanks for this nice article. bank career

  2. Fantastic script and very versatile. I am using your script in a project that uploads photos to a server. However, these photos cannot be viewed online after they are uploaded. Upon some investigation, I discovered that the files are inheriting the folder permissions of the temporary folder that they are being written to and are carrying those properties over to the final, intended folder that they are written to. I have modified the script to chmod these particular files (the files are always the same name in my purposes,) however a cleaner code that would automatically chmod the desired permission to any file uploaded would be nice. Good job.

  3. 2157
    Danny E

    I read through all the comments and nothing was quite clear with the issue I am having. A few people have asked the same question and there was no direct response that I could find. I apologize if there was but I really need some direction. I have installed the plugin in a wordpress installation. Everything works great except for one thing. The auto reply feature doesn’t send an e-mail to the person filling out the form. For instance if I have a contact form with Name, E-mail, Message, and want an auto-response e-mail to be sent to the user notifying them that their message was received and they will hear from me shortly, the auto-reply goes to the sender or auto-reply e-mail I entered in setting up the form, Not the visitor. I am lost on what to do and have not seen any instructions on how to handle this. Please respond with some help anyone who knows a solution. I thank you so very much in advance.

    Danny

  4. A very usefull script i use it on mnay sites i own

  5. ning to shut them down because of all of the Spam their site was generating. Your script allowed me to quickly resolve their problem. It truly is a godsend and it’s great that you are sharing i

  6. the rest of the time on most close favorite about ladies fans to go on holiday, think about it very Happy it, whether in the sand by the sea, or the green lawn, wearing a bright color outfit.

  7. Love your script – use it on a couple of my sites. Thanks!

  8. Appreciate your insights here, keep up the great work.

  9. this is the best wy of communiction we like it
    Orlando Audio Visual

  10. 2150
    Philadelphia Slip and Fall Lawyers

    Philadelphia Slip and Fall Lawyers

    Philadelphia Slip and Fall Lawyers

  11. 2149
    fawad

    Philadelphia Slip and Fall Lawyers
    this is ver informative

  12. 2148
    fawad
  13. 2147
    fawad

    most efficient clint it is
    Philadelphia Slip and Fall Lawyers

  14. 2146
    fawad
  15. 2145
    spotlight

    hHa OMFG! http://bitly.com/srzhdn U4n

  16. 2144
    spotlight

    eQk OMFG! http://bit.ly/tpkFZT A1v

  17. 2143
    spotlight

    hi this is nice

  18. Ah well your comment! I did you good!erewhbj

  19. Ah well your comment! I did you good!

  20. The script is very helpful and flexible. Thank you. I think it would be nice if incorrectly completed fields will be highlighted.

  21. If you use the visual editor it will not work, as the actual code you entered will be seen on the page, instead of being processed by the script.

  22. Other adjustments to email headers. Added ‘id’ declaration to select boxes. Fixed incorrect example code in the instructions. Other minor changes.

  23. 2137
    Alan

    Thanks for your script its been a valuable look into php form scripting but can you tell me how to add a hidden field in the form or the code priod to adding a html hidden field ie before input name=”fm_hidden” type=”hidden” value=”staff”

    Thanks

  24. 1 — Thank you so much! I am using your code on the Vermont Reptile and Amphibian Atlas site (vtatlas.org), in conjunction with some other code from here and there and my head…

    2 — I’m working on tweaking the email output so it doesn’t send a line if the form input for that field is blank. I haven’t seen this in the comments, and while I might figure this out before I get back here to look for replies.. I might not. So suggestions are welcome! I’m thinking I’ll need to edit either each of the cases or the loop through getting all the input and putting it in an array… (the bit that starts

    		foreach ($_POST as $key => $i) {
    

    Anyone else out there working on something similar who can save me some time?

  25. Great Site, your plugins are very useful and save me a tonne of time.9

  26. medicines for lyme disease [url=http://provigil.ucoz.com/blog/buy_provigil_cheap/2011-11-04-31#463] buy provigil cheap [/url] medicine of liver cancer
    target store pharmacy [url=http://provigil.ucoz.com/blog/buy_provigil_generic/2011-11-04-32#208] buy online us generic provigil [/url] patrick afb pharmacy
    evidence based medicine and powerpoint [url=http://provigil.ucoz.com/blog/buy_provigil_modafinil/2011-11-04-33#731] buy provigil modafinil wakefulness [/url] medium rite medicine
    new york journal of medicine [url=http://provigil.ucoz.com/blog/buy_provigil_no_prescription/2011-11-04-34#347] buy provigil online no prescription discount [/url] homosexuality in medicine 2008
    physicians committee for responsible medicine wikipedia [url=http://provigil.ucoz.com/blog/buy_provigil_online/2011-11-04-35#581] where to buy provigil online generic [/url] red ear slider injured foot medicine
    pill crusher pharmacy [url=http://provigil.ucoz.com/blog/buy_provigil_online_canada/2011-11-04-36#485] link [/url] qualifications to study medicine
    community pharmacy saco me [url=http://provigil.ucoz.com/blog/buy_provigil_online_no_prescription/2011-11-04-37#947] buy provigil online no prescription he [/url] cvs pharmacy helicopter
    clip art medicine wheel [url=http://provigil.ucoz.com/blog/buy_provigil_online_uk/2011-11-04-38#805] buy provigil uk online [/url] pharmacy admissions hints
    wellston behavioral medicine [url=http://provigil.ucoz.com/blog/buy_provigil_online_without_prescription/2011-11-04-39#676] buy provigil online without prescription [/url] meridia pharmacy low prices
    dispensing medicines in alabama [url=http://provigil.ucoz.com/blog/buy_provigil_without_prescription/2011-11-04-40#459] buy provigil without prescription [/url] building medicine cabinets
    independence home pharmacy dme mailorder <a href=http://provigil.ucoz.com/blog/buy_provigil_cheap/2011-11-04-31#932] buy cheap provigil modalert internal medicine doctors in new york
    pnt pharmacy ltd accra ghana <a href=http://provigil.ucoz.com/blog/buy_provigil_generic/2011-11-04-32#692] buy provigil generic veterinary medicine zenequin
    online mexican pharmacy online <a href=http://provigil.ucoz.com/blog/buy_provigil_modafinil/2011-11-04-33#592] buy modafinil provigil prescription pharmacy school il
    herbal medicine alternative <a href=http://provigil.ucoz.com/blog/buy_provigil_no_prescription/2011-11-04-34#454] buy provigil online no prescription modafinil nucofed cough medicine
    chest and chinese medicine <a href=http://provigil.ucoz.com/blog/buy_provigil_online/2011-11-04-35#405] buy provigil online best stop shop pharmacy methuen ma
    wellpartner mail-order pharmacy <a href=http://provigil.ucoz.com/blog/buy_provigil_online_canada/2011-11-04-36#031] link health systems pharmacy
    family discount pharmacy logan wv <a href=http://provigil.ucoz.com/blog/buy_provigil_online_no_prescription/2011-11-04-37#652] buy provigil online no prescription needed brookshire pharmacy salado
    homeopathic medicine universities <a href=http://provigil.ucoz.com/blog/buy_provigil_online_uk/2011-11-04-38#650] buy provigil uk online lower blood sugar without medicine
    institute of antiaging medicine houston <a href=http://provigil.ucoz.com/blog/buy_provigil_online_without_prescription/2011-11-04-39#948] buy provigil online without prescription kingston pharmacy ok
    ingalls family medicine clinic <a href=http://provigil.ucoz.com/blog/buy_provigil_without_prescription/2011-11-04-40#183] buy provigil without prescription dietary alternative medicine

  27. At ordinary times what would to bring it. Hollywood stars also and everyone oh, they also have their own especially like to wrap, as long as they take it out of the street watching the frequency will know that!!!!!

  28. 2132
    Mara

    The script is very helpful and flexible. I think it would be nice if incorrectly completed fields will be highlighted.
    Das Script ist sehr hilfreich und flexibel. Ich fände es schön, wenn fehlerhaft ausgefüllte Felder farblich hervorgehoben werden würden.

  29. so great..but i have another idea..

    boots

  30. 2130
    Andrew

    This is a great script Dagon, thank you very much :)

  31. Ad oggi uno dei marchi più grandi del mondo della moda, pelletteria Gucci è avviato, che sfruttano quando Gucci è stata fondata nel 1921, un prodotto importante. Per celebrare il 90 ° anniversario di Gucci deliberatamente emessi chiamato “gucci 2011“, serie di nuovi modelli di lusso per uomo e donna. Questi sono in edizione limitata: l’utilità di queste Gucci Borse a mano di bambù o di coccodrillo, grande arco colori dal marrone scuro, rosso ciliegia al verde scuro. Gucci (Gucci) 2011 e le tendenze autunno inverno Baoxie semplici ed eleganti nella forma e nel design, con un tono seppia low-key di lusso.Economico Scarpe Gucci Accessori da uomo tendenza, corrispondono alla moda perfetta per piccoli dettagli della transazione con un design semplice …

  32. 2128
    jack

    thanks for sharing.
    Google

  33. Hemming jeans, casual enough, but it must be high-heeled open-toed sandals costume refreshing look nice,True Religion Men’s Billy Natural Super T-Medium Drifter with Rips trousers folded, the visual focus falls on the sandals on, so you can pick some shiny, sexy sandals, like the thin band style can make the feet appear to be more slender, two-tone gold and silver sandals and added a bit of luxury. High-heeled slippers is also an option,True Religion Billy Super Big T-awless Land Dark are much more casual than casual sandals.Victoria hemming jeans lined with black suit, into the type into the cell, so most people do not pour a risky, in fact, mix it with the coat can be varied. Typically the sleeve is white with a small waist suits, lined vest, so work is not rude. Lining on the sleeves knitted pullovers, knitted cardigan, V-Neck tight-fitting T-shirt, vest or shirt POLO Tee, etc., are the same good-looking. More wonderful dress, is to make shoes and handbags or coat some of the color match up, and let the jeans as a transition,True Religion Men’s Billy Twill Pants-Tan Stone so dress up as a whole is much sense of it.

  34. Vezbe mrsavljenje

  35. Vicevi o Cak Norisu

  36. Very nice article. Very useful.Thank you!htfyht

  37. I really like your form mailer. It works great. It would be nice if it was updated with the HTML 5 input types though.
    I have made some quick adjustments a couple times when using your form mailer, but it would be nice if it was packaged in the script.

  38. Thank you very güzle mail a form of expression, and for your comments

  39. 2121
    Mike

    Hi I have been using your form for quite a while now but just recently noticed an issue with the verification code in I.E. 7, is there a fix for this? I have been searching google to find any answers but no luck so far, any help here would be great.

    I did find one other person on your fourm with what looks like the same issue

    POSTING 1982

    If there is a direction to point me in that would be great

    Thanks
    Mike

  40. To add an instant statement to a favourite winter coat, let the scarf do the talking. For something alternative and striking, Alexander McQueen’s designs are an investment.

    For ultimate indulgence, a Moncler ski jacket is the perfect gift for the girl (or guy) who has everything.

    Start spoiling.

  41. Thank you , finally found a functional PHP mailer script.

  42. type=select|class=|label=|fieldname=|[multi=true]|[req=true]|data=(#group),
    (text),(text),(#group),(text)

  43. Researchers recently gathered in Goteborg, Moncler Giubbotti Sweden, planning the slaughter of livestock can not get meat approach. Over the past 10 years scientists have been studying meat painless method, but later appeared in several false dawn, did not change an indisputable fact. Gothenburg, Chalmers University of Technology Julie – Gould said: “No one has yet to produce in vitro meat.” She was responsible for organizing the meeting. University of Maastricht, the Netherlands, according to Mark – Poster said that the first lab-grown out of the sausage may become a reality within six months, he was the main pioneer of this Moncler Giacche technology and loyal supporters. Poster has been tested using pig cells, recently found in a laboratory environment to cultivate muscle tissue method. And he has cultivated a similar muscle meat, each of length 2.5 cm, width 0.7 cm

  44. Very nice article. Very useful.Thank you!htfyht t

  45. Nice post, I really like this post style.
    Ivan @ souplantation coupons 2011

  46. Damn it. I really need to eat something after this.

  47. Thanks for writing, I truly enjoyed reading your newest post.

  48. I always gain new ideas here. very goo site.dtgre

  49. I m going to use this e-mail method on my site. Thanks you for ur generosity.

  50. Thank you so very much for taking the time to share…very useful, indeedxxv!

  51. Thanks for a nice share you have given to us with such an large collection of information ccdffd

  52. 2108
    Morgan

    I am having a syntax problem with the “=” sign in this statement:
    Can anyone see my problem, or offer any suggestions? I am all out of ideas!

    Syntax error found: unexpected ‘=’

    type=checkbox|class=fmcheck|label=Interests|data=fm_i1,Volunteer,false,false,fm_i2,Get Email Updates,false,false,fm_i3,Make Calls,false,false

    Here is the css
    form.ddfm .fmcheck {
    width: 65%;
    float: left;
    display: block;
    margin-bottom: 15px;
    }

    Thanks so much for looking!

  53. You guys realy rock! Not the mineral.. :) )

  54. I thank
    you for taking your time sharing your thoughts and ideas to a
    lot of readers out there.

  55. All these tinny details are made with lot of background knowledge.

  56. fernsehen im internet kucken und tv auf dem computer

  57. hunde trainieren und labrador retriever erziehung

  58. Wow thanks for the share dude!

  59. Great script! Thanks for the share man :)

  60. I have found a few good stuff here. And this PHP secure form mailer script is nice too. But I would like to check out others’ comments before using it to my blog.

  61. RN to BSN this form plugin is a great find, but be careful if not used correctly for nursing sites it may get hacked.

  62. 2098
    Dan

    This form is NOT secure. It got hijacked and spammed a bunch of people into oblivion. not happy :|

  63. AAAA

  64. Just tried manually specifying the format (‘gif’, ‘jpeg’ and ‘png’). None of them worked, still not seeing the image.

  65. I have a reallllly long form. It works great with your script but if the user makes an error, it wipes out the ENTIRE form and they have to start over. I would like it to keep the good data and just show the message. I have tried searching all 2000 messages but I can’t find anything about how to address this. PLEASE HELP!

  66. hello.
    I’m a user of a VERY old version of your form-mailer-script pkg.
    I never upgraded, because it worked so well and gave such good results. I’m sure I should upgrade; but I do have a question about an issue I’m having with the old version. I realize, that you may not support it anymore; but the problem is probably on my end.

    I recently created a file, i.e. /root/myfile.php.
    I made sure that the accompanying myfile_fm.php file was in the same path, i.e. /root/myfile_fm.php.
    Once that was done, everything worked fine.
    Then later, I created another file, i.e. /root/xfolder/myfile2.php
    with it’s accompanying /root/xfolder/myfile2_fm.php.
    Instead of setting the path in the /root/xfolder/myfile2_fm.php,
    as src=”../formmailer_verify.php…” I put a copy of the “formmailer_verify.php” in the /root/xfolder/ and left it.
    It seemed to work fine, but the first file I created, /root/myfile.php began to have a problem with the blue ‘verify box’ not displaying the numbers on first load. The box displays blue, but no numbers appear. If I refresh the page the numbers return. However, I fear that visitors will not hang around long enough to refresh the page to see the captcha numbers, in the verify box. What could have happened that changed to that behavior?
    Is it still a path issue?

    On another, note, how much effort will I need to upgrade to the newest version and eliminate these kinds of issues?
    I have 4 files that would need changing, if I decided to upgrade.

    I still appreciate your work and your help with this. I’d be happy to donate again, to the cause, after I upgrade and get things fixed.
    Thank your for any help you can give me.
    A loyal user since 2004
    Shobuz99

  67. 2093
    Susan

    Ooops. Never mind. It was the path. :-) My bad.

    Other Q: do you have a way to “refresh” the image without reloading the page?

  68. 2092
    Susan

    Just tried manually specifying the format (‘gif’, ‘jpeg’ and ‘png’). None of them worked, still not seeing the image.

  69. 2091
    Susan

    Hi,

    Love how configurable this is. Having one problem: trying to use it with your simple captcha rather than ReCAPTCHA. I’m not seeing the image. Have left all your files as is, haven’t edited yet. What am I doing wrong?

    Also, does your simple captcha have a refresh image feature (for someone who can’t make out the code)?

    Many thanks!

  70. I visited this page first time and found it Very Good Job of acknowledgment and a marvelous source of info………Thanks Admin!

  71. 2089
    mjp

    doesn’t work. one problem after another with this program. moving on.

  72. Thanks for this script!

  73. 2087
    James

    I’ve seen this question asked a lot here, but I’m still not sure of the answer. How do you put things on the same line? For example.. 3 radio button choices on the same line instead of stacked on on top of the other?

    I love this script, but that’s always the part that stumps me. Nothing else. Just a little nudge in the right direction with a sample code would be greatly appreciated! Thanks again.

  74. 2086
    sun

    Microsoft is doing best in the field of software,so it best package for us breckenridge condo rentals

  75. I have enabled recaptcha method and I have three forms, but one of them have no the captcha. Any ideas? Tnx.

  76. Nice Review, thx!

  77. Great script and have been using this for a while with great success, however… is there a way to add an option for smtp authentication as some hosts now require it which means the script fails to actually get the mail sent?

    $host = “mysmtpserver.com”;
    $username = “mysmtpusername@mysite.co.uk”;
    $password = “mysmtpauthpassword”;

  78. Nice review, going through it now, stll trying to make sense of it all, anyway thanks.
    Forecourt Signs

  79. Struggling with the script A Boards, can anybody clarify it

  80. 2080
    sun

    There are four difficulty levels and a good deal of customizable options that allow you to dress up (or down) your rock star avatar, and the game allows you play both bass and guitar. A Boards

  81. 2079
    sun

    Help us build our fast growing web directory. Free & Featured Links yahoo answers posting

  82. deneme a.g.

  83. Hi – I’ve been referred to this page by a friend.

    I’m not proficient enough to make the amendments to my Contactus .php page and my form-mail page.

    I don’t know if you can assist. But if you can I am willing to pay you.

    The problem is I keep getting junk enquiries in my Contact dialog boxes. The tel numbers are fake, the email addresses are fake and the Details dialog box is filled with lines and lines of http links to dubious sites.

    I was hoping to get some script so that all non standard characters are prohibted such as ‘http:’, ‘//’ etc. Also a verification script that sends the email back to sender for re-sending direct to me.

    Could you have a look at my Contactus.php page and see what you think? Also I can forward the Formmail page to you if required.

    Your scripting probably can take care of all this but I am no programmer.

    ReCaptcha support would be useful if poss.

    thanks Chris

  84. Hi G Brown, I have looked at your website, can you help me with integrating my form to my site please?

  85. Like the script but confused about the multiple recipient line. It doesn’t go in the recipient = line. I tried that and it wont send. I have also tried set up the line in $form_structure but it won’t work with the $recipient line blank. can you give an example of exactly where to put the line for multiple recipients? Thank you

  86. I am clueless with all this. The PHP script has been added to my site but how do I integrate it into my site?

  87. I genuinely don’t get the point of this article. Football and the Premier League included doesn’t care what sexuality you are and has certainly never not allowed someone to play for being gay

  88. You could be NO1.I believe. cheap nfl jerseys The best preparation for tomorrow is doing your best today.

  89. 2071
    Denis

    Hi,

    How to validate numeric fields??? Kindly help me….

    Thanks in Advance. :)

  90. Following the advise with the basic test script not producing any msg, I contacted my hosting provider, who sent me a crabby response about having to use PEAR.

    Did I mention I know diddly squat about PHP and my programming skills are at best archaic? (anybody for Pascal?)

    So thank heavens and Sergej for Google, as I was able to come up with the following modification to the sendmail function.

    Note that multiplle recipients will no longer work and includes for mail.php and mail/mime.php have to be added to the top of the function.

    $msg .= $email_msg . PHP_EOL . PHP_EOL;

    $headers = array (‘From’ => $sender_email, ‘To’ => $recipients, ‘Subject’ => $email_subject);

    if (count($attachments) > 0) {

    for ($i = 0; $i setTXTBody($email_msg);
    $mime->addAttachment($attachments[$i]['tmpfile'], $attachments[$i]['content_type'] );
    $msg = $mime->get();
    $headers = $mime->headers($headers);
    }

    }

    }
    }

    @ini_set(’sendmail_from’, $sender_email);

    ini_set(‘SMTP’, “mail.yyy.com”);
    ini_set(’smtp_port’, “587″);
    ini_set(’sendmail_from’, $sender_email);
    $username = “xxx@yyy.com”;
    $password = “123456789″;

    $smtp_msg = Mail::factory(’smtp’, array(‘host’ => ini_get(‘SMTP’), ‘auth’ => true, ‘username’ => $username, ‘password’ => $password));
    $send_status = $smtp_msg->send($send_to, $headers, $msg);

    if (PEAR::isError($mail)) {
    echo(”

    ” . $send_status->getMessage() . ”
    “);
    }

    @ini_restore(’sendmail_from’);

    return $send_status;

    I am sure I overstepped my boundaries and there are better solutions, but this one…well…works.
    I am fairly confident it will even work with gmail, for those who are asking about that.

    Btw, for reasons unknown I could not store username and password through ini_set.

  91. 2069
    sun

    please read through the comments because most common issues have already been discussed many times. Thanks.
    masters engineering management

  92. Posting is great.

  93. 2067
    Jeremy

    Also noticed an extra space on line 1127:
    $gen .= ' /></p>' . "\n\n";
    In addition, I was having an annoying problem with an “Error sending message” error. For the benefit of others who may experience this, it is worth mentioning that if you haven’t removed the “$headers” value from this line:
    $send_status = mail($send_to, $email_subject, $msg, $headers);
    …and you have an email field that is required, the address you use to test the form field should be a real email address.

    I also wanted to point out that if you DO remove the “$headers” value mentioned above, the images I tried to attach would not send. However, using the default message, it would show the filenames that were supposed to be attached and then output the images in ASCII format like this:

    /9j/4AAQSkZJRgABAgAAZABkAAD/7AARRHVja3kAAQAEAAAAMgAA/+4ADkFkb2JlAGTAAAAAAf/b
    AIQACAYGBgYGCAYGCAwIBwgMDgoICAoOEA0NDg0NEBEMDg0NDgwRDxITFBMSDxgYGhoYGCMiIiIj
    JycnJycnJycnJwEJCAgJCgkLCQkLDgsNCw4RDg4ODhETDQ0ODQ0TGBEPDw8PERgWFxQUFBcWGhoY
    GBoaISEgISEnJycnJycnJycn/8AAEQgCRQMgAwEiAAIRAQMRAf/EALwAAQABBQEBAAAAAAAAAAAA
    AAAFAgMEBgcBCAEBAQEBAQEBAAAAAAAAAAAAAAECAwQFBhAAAQMCAwQGBgUJBQUHAwUBAQACAxEE
    IRIFMUFRBmFxIjITB4GRobFCFMHRUnIjYoKSorIzJDQV4cJDUxbwc0RUNfHSY4OjJTaTsxfi8uNk...
    

    Hope that’s helps!
    Thanks again for sharing the script!

  94. Sorry for my english, I’m using Google Translate.
    I can not configure SMPT in a plugin.
    The only place in the code plug in one place (where I found) I changed:

    @ ini_set (’sendmail_from’, $ sender_email);
    $ send_status = mail ($ send_to, $ email_subject, $ msg, $ headers);
    @ ini_restore (’sendmail_from’);

    on

    ini_set (“SMTP”, “smtp.google.com”);
    ini_set (“smtp_port”, “465″);
    ini_set (“username”, “my_mail@sonikelf.ru”);
    ini_set (“password”, “password”);
    ini_set (’sendmail_from’, $ sender_email);
    $ send_status = mail ($ send_to, $ email_subject, $ msg, $ headers);
    ini_restore (’sendmail_from’);

    But it still does not work and letters are sent as usual.
    What am I doing wrong? How do I fix it?

  95. 2065
    Jeremy

    Absolutely fantastic script you have here – Thanks so much for sharing!

    Noticed an extra space in the generated code for Select fields on
    line 1079:
    $gen .= ' >' . $data[$i] . '</option>' . "\n";
    Which outputs:
    <option >Value</option>

  96. Absolutely the most advanced and professional mail form ever! I have used this once now for a client, and im going to use it way more often! Thank you soo much! 10/10!!!

  97. 2063
    Dean

    Hi, I have used this script many times in the past and it has worked a dream, still does however I wondered if anyone else was having problems reading the sent message in office outlook 2010. Since I have upgraded i have not been able to read the messages that were sent to me. Cheers

  98. 2062
    Person_guyz

    Can anyone, in explicit terms (thorough instructions) tell me how to do this? I’ve read every comment on the board and tried variations until I’m blue in the face and still can’t seem to get this to work.
    revitol

  99. 2061
    Husen Said

    Sorry, didn’t check it that much. It seems it does validate email. But how do i set it to verify the email? Do I have to set it in form structure block?

  100. 2060
    Husen Said

    If I’m not wrong, there is no email validation option. Right? Can you suggest me a way to do so?

  101. 2059
    person_guyz

    Can anyone, in explicit terms (thorough instructions) tell me how to do this? I’ve read every comment on the board and tried variations until I’m blue in the face and still can’t seem to get this to work.
    replacement windows

  102. Can anyone, in explicit terms (thorough instructions) tell me how to do this? I’ve read every comment on the board and tried variations until I’m blue in the face and still can’t seem to get this to work.

  103. Very informative post.
    Many thanks for sharing.

  104. 2056
    Person

    Can anyone, in explicit terms (thorough instructions) tell me how to do this? I’ve read every comment on the board and tried variations until I’m blue in the face and still can’t seem to get this to work.
    Metaphors and Language Patterns

  105. hey thanks what a great script …… Thanks

  106. 2054
    Ken

    How do you add a link in the auto reply message? I’ve tried using html, but the html shows up!
    Thank you for your help!
    Ken

  107. 2053
    person_guyz

    Hi, Great script. Worls great but with attachment i get this error message ”Error saving file. Check your path and permissions. Stopping script.
    golden corral coupons

  108. 2052
    person_guyz

    I can’t seem to figure out where to put the SMTP authentication code. I did a search for the “mail()” function but there is none in the “dd-formmailer.php” file. Would appreciate some assistance, I suck majorly when it comes to php mailers. Ugh.

    neon signs

  109. 2051
    person_guyz

    Hi, Great script. Worls great but with attachment i get this error message ”Error saving file. Check your path and permissions. Stopping script.business bachelors

  110. Hi!
    T hanks for sharing Great script but i also get the error, while saving the file..

  111. Hi, Great script. Worls great but with attachment i get this error message ”Error saving file. Check your path and permissions. Stopping script.

  112. 2048
    Marie

    I’m trying to get the calendar (popup) to work but I don’t know where i have to put this

    <script type="text/javascript" src="(/dd-formmailer/date_chooser.js)"></script>

    I’m using the standalone version so if anyone can help it would be greatly appreciated!!

    thank you!

  113. 2047
    Maria McDowell

    This is a great script that I have used on a number of sites. The current site I am considering installing it on requires use of the ’selrecip’ feature. I am not a coder. Can anyone tell me how a site visitor can click a link and be taken to the contact form with the clicked recipient already selected?

    This question has been asked a number of times (passing variables, using the $_GET command) but I have not seen a solution. Since I don’t know php well, I was hoping someone could offer some suggestions.

    Thanks,
    Maria

  114. 2046
    Arlene

    Hi There,

    I was trying to test your code but for some reason I couldn’t get it running properly. I followed the “Installation” instructions. I uploaded the entire directory to my website. The only configuration I set was the filepath to dd-formmailer.css and changed the email (recipient) to my email but when I try submitting the form, it doesn’t send. It just looks like it refreshes and the verification code changes like I’m supposed to fill out the form again.

    I was thinking maybe its my server preventing this so I tried the <?php mail('you@domain.com', 'test subject', 'test message'); ?> that I was reading about and I did get the email when I ran that so I’m not sure what i’m doing wrong.

    Please advise and Thanks so much!

  115. I can’t seem to figure out where to put the SMTP authentication code. I did a search for the “mail()” function but there is none in the “dd-formmailer.php” file. Would appreciate some assistance, I suck majorly when it comes to php mailers. Ugh.

    Thanks!!

  116. 2044
    Drew

    I’m using the WordPress Plugin (V5.6) and wish to pass a value into the form through the URL like this:

    http://mysite.com/contact.php?fm_partner=apartnername

    Can anyone, in explicit terms (thorough instructions) tell me how to do this? I’ve read every comment on the board and tried variations until I’m blue in the face and still can’t seem to get this to work.

    Any help would be IMMENSELY APPRECIATED.

    Thanks in advance

  117. 2043
    Caro

    I love the way the brain works!! I couldn’t work out why the asterisks were not showing and I worked on this problem for hours. As soon as I submitted a comment, I went back and had another look, and that was when I discovered that the Language file was not on the server!
    Thank you for a wonderful site.
    Caro.

  118. 2042
    Ray

    Ok problem solved. Had a bad path in setting.
    Great tool. I will donate for sure.

    Thanks

  119. Hi, Great script. Worls great but with attachment i get this error message ”Error saving file. Check your path and permissions. Stopping script.

    Any clue?

    Thanks

  120. How is it different from phpmailer and swiftmailer? or I am missing something?

    Thanks

  121. 2039
    kris carlson

    i have the script running on dir for a website on a dedicated server. this server is also running as the email server for this domain and email works fine. why when i fill out the form do i not get an email?

  122. I was looking for adding contact form in wordpress and this really helped me. Great job.

  123. 2037
    Phil

    Jim – 2036

    Good point but I do not have a line 1883, mine stops at 1700 ish.
    Could you be more specific please?

  124. Script, as is, generates an error when validated against XHTML 1.0 Transitional.

    Recommend change line 1883 in dd-formmail.php to read as follows:

    
    $o .= "<script type=\"text/javascript\">
    

    After this change, form generated validates for XHTML Transitional.

    Best Regards,

  125. Excellent script, does exactly what I need and so easily configured too.
    Many thanks

  126. Hi,

    As a frequent user of your script, I find that the cookie/session add-on does not prevent a refresh (auto-resend). Is there a work-around? or solution?

    Rich

  127. Hello all. I’ve seen a couple of people here list the same issue I was having. Tracy (2027) and Stan (1895). I’ve solved it for my case and wanted to suggest that they may find success with the same EASY solution. Issue:

    “No verification code generated”.
    and no email being sent.

    If you use some version of this form on multiple sites albeit with modifications make sure that the “$script_path =” is to the current site you are installing it on. I had mistakenly changed the “$path_contact_page =” without changing the full url to the script. This caused a situation where for a good twenty minutes of head scratching the verification image was displaying because it was being pulled from another site but wasn’t being passed through the php because it was from a separate domain. We all get tired and overlook things so I wanted to put this out there in case it helps someone avoid 20minutes of head scratching or hair pulling etc.

  128. Very nice, thanks very much for your effort…

  129. 2031
    jayray999

    Can the “SAVE DATA TO FILE” feature be extended to allow admins to choose individual fields that are saved? For example can I choose to save Name and Email Address but not the message or any other user inputted field?

  130. Is there a way to use HTML/CSS to format the auto_reply_message?

    Is there any limit on the amount of text this message can contain?

    If I try to use HTML elements such as or , the auto reply message doesn’t get sent.

  131. hello

  132. 2028
    andrew koop

    I apologize in advance if you get this question all the time. Do you have any suggestions on how to limit the numbers of responses for a question in a contact form?

  133. Getting same problem as Stan (1895) posted but I don’t see an answer/response to his query.

    Form is working fine except for Internet Explorer — getting the following when someone fills out the form, puts in the correct code, and presses submit:

    “No verification code generated”.

    The email is never sent.

    The script is working fine in Firefox.

    This is happening on several sites I’ve used the script on, and is happening on the Wordpress version and the php version.

    I’ve had to remove verification off a few sites recently and I’m wondering if I need to find another form script to use. However, I’d prefer not to as DD-formmailer is my favourite one…as long as it works on the most commonly used browser :)

    Anyone know what could be causing this issue in IE.

    Thanks for your help in advance.

    Cheers,

    Tracy

  134. how to make the attachment works?

    Im trying to attach a PDF with each mail but keep getting errors.

    I currently added the following to $form_struct

    
    type=file|class=|label=|fieldname=|[req=true]|[allowed=1,2,3]
    

    but my page at http://www.1001-reizen.nl is not sending attachment. why?
    btw: Great script, thank you so much for all your work!

  135. Equipment Management Software
    Your supply chain is a complex operation consisting of multiple people and many moving parts. As strong as your own team is, you are constantly impacted by your suppliers and customers. Not many truly understand the challenges you face ensuring that everything including raw materials, manufacturing, inventory, equipment and assets are all in place and functioning to meet the customer’s expectations.

  136. Awesome script! Thank you!

    Is there a way to pass variables to form fields? For example, I have a drop-down select list and I’d like to pass a POST variable to automatically choose an item in the list. Is this possible with this script?

  137. Hi,

    Thank you so much for this terrific and fully featured script…

    I liked Kaipee’s idea to add placeholder text but found it would submit that text so found a solution that uses HTML5 placeholder text rather than rather than default text. Used in combination with a in combination with a small jQuery plugin for IE it’s working beautifully. Wrote it up here: http://www.lazydada.com/2010-09-24/php-web-forms/

    Thanks again

  138. Hey thanks for this! I was looking for something that I can easily integrate with plenty of features. I have added a few tweaks on my site though (some javascript so clear text fields, etc.).

    You can view here : http://www.mytilesandbaths.co.uk/contact.html

  139. Problem 1: (most important)
    I am getting a “Error Sending Message”. Like the person below me I have tried everything I can find in the troubleshooting guide. I am at a loss. This is a great script.

    Problem 2: (not important)
    I try to use my recaptcha keys but get an error on the file at line 1894. This issue isnt and big as the other one but any ideas would be great.

    Thanks for this!
    Brad

  140. 2020
    Ryan

    i keep getting Error sending message! when I hit the submit button. I have tried everything in the trouble shooting guide.

    is there a was to show the error?

  141. I cannot get the verification code to display. I have tried to set the Force Image Type but I do not think I wrote it in the right place. I could use some assistance. I’d just as soon disable the verification code and just have the ‘Send Email’ button but can’t figure out how to do that either.

    Thanks for your help.

    Beth

  142. 2018
    Mar

    Your script is fabulous. Thank you!

  143. 
    Well firstly great job with the script.
    
    I am a php newb. and i found your script to be easy to understand how ever being a newb and all i found it strange that everything works well with no hassles.. with my luck i was supposed to get errors all over the place... Well this is not the matter at all. I'm in fact struggeling wiht 2 things.
    1. redirect code - in which line do i change the "$o .= $sent_message;" code.. when i change the code in line 1790 with $o .= '<META HTTP-EQUIV="REFRESH" CONTENT="4;URL=http://www.itr.co.za/">'; i get a server error "500" if i use the javascript code i get nothing, no redirect. i want it to redirect to my custom thank you page  http://www.itr.co.za/thankyou.php/
    2. My messages are emailed correctly to me via the script how ever, i get the form body but no input fields for e.g
    Contact Name = Humpty Dumpty
    Contact Email = mydomain@mydomain.co.za
    Subject = When last did the sun shine. ...... I recieve the mail with 
    Contact Name = 
    Contact Email = 
    Subject =         ...... please help
    
    Here is the code:
    
    // FORM STRUCTURE
    // This is used to generate the form. Each form element must be on its own line.
    // Detailed usage instructions can be found on the web page
    
    $form_struct = '
    	type=text|label=Contact Name|fieldname=fm_name|max=15|req=false
    	type=text|label=Company Name|fieldname=fm_cname|max=100|req=false
    	type=text|label=Contact Number|fieldname=fm_cnumb|max=10|req=false
    	type=text|label=Email|fieldname=fm_email|max=50|req=false
    	type=textarea|label=Description|fieldname=fm_description|max=200|rows=10|req=false
    ';
    
    and
    
    // SPECIAL FIELDS
    // These options help generate the email headers. Simply enter a field name,
    // and the user input from that field will be used. You can also combine fields. 
    // For example, if you have a fm_firstname and fm_lastname field, you could 
    // set $sender_name to 'fm_lastname, fm_firstname'
    
    $sender_name = 'fm_name';
    $sender_company = 'fm_cname';
    $sender_number = 'fm_cnumb';
    $sender_email = 'fm_email';
    $email_description = 'fm_description';
    
    Thanks
    

  144. The name, email, phone and subject fields do not have a space between the label and the text field. Verify and text area do and I cannot find the difference.

    http://www.saltlakeexecutivelimo.com/contact/contact.php

  145. 2015
    Peter

    How can I add multiple file uploads? how do i set 2 different unique field names for it?

  146. Hi, I have my own form html page in czech language. I just want to process the data inputed in czech in my form by your php formmailer so the czech language gets displayed properly and then reference and display my own confirmation page. Can you help please?

  147. Hi, very great script, but i´m missing one thing:

    I want the user to upload a picture file (no problem).
    but the file need to be sent by email (no problem) AND be viewed in the success message. the user has to see what he has uploaded in the success page to check it. i did find no answer. could you help me please?

    greetings from germany

  148. 2012
    Caro

    Why is the verification code not working with the safari and IE browsers? I set it all up tested on Firefox, but now I have tested on the others and I get “Errors!No verification code generated”.
    Is there something I can do to fix this? I hope you can help.
    Thanks,
    Caro.

  149. How can I add a message on the top of the form page that goes away when the message is sent?

  150. good

  151. Hi Billy,

    I’m having the same problem that you’re experiencing! I keep getting “DDFM_REQUIREDTAG” on the form. All of the files have been uploaded and I went through the entire PHP “dd-formmailer.php” file to see if I could find the answer. The weird thing is that I took this same exact PHP file from another form that I had used and I never got these “DDFM_REQUIREDTAG” fields on my online form.

    Here’s where you can see the issue. Note: the form works great, but I just have these un-needed DD_REQUIREDTAG statements on my form.
    http://robstathem.com/rws/contact.php

    If anyone has any suggestions for me, I’d greatly appreciate it. I’m back to seeing what else I can do to fix this.

  152. Awesome script! Can I use ONLY the parsing and mail functions?

    I have my own gorgeous custom contact form I would like to use from my home page. I’d rather not switch pages but just wish to parse the contact fields with your FANTASTIC parsing and ip/host collecting agents. If I could make a little jpg of my choice pop up in my homepage as a oonfirmation that would be perfect.

    Possible?

    Thank you!
    HR

  153. 2007
    israeli

    no Hebrew :(

  154. Thank you fo great script, Dagon! Would you be so kind to assist me with my minor issue with it. The problem is in encoding of the email headers and the subject. And the only those I recieve with actual message. In the same time the sender recieves right headers in auto response message. This are the lines i changed

    	$sender_name = ddfm_injection_test($sender_name);
    	$sender_email = ddfm_injection_test($sender_email);
    	$email_subject = ddfm_injection_test($email_subject);
    	
    	if (function_exists('mb_encode_mimeheader')) {
    	$email_subject = mb_encode_mimeheader($email_subject, 'windows-1251', 'Q', '');
    	$sender_name = mb_encode_mimeheader($sender_name, 'windows-1251', 'Q', '');
    	}
    

    as well as those

    	$headers .= 'From: ' . $sender_name . ' <' . $sender_email . '>' . PHP_EOL;
    	$headers .= $extra_recips;
    	$headers .= 'Reply-To: ' . $sender_name . ' <' . $sender_email . '>' . PHP_EOL;
    	$headers .= 'Return-Path: ' . $sender_name . ' <' . $sender_email . '>' . PHP_EOL;
    	$headers .= "Message-ID: <" . time() . "ddfm@" . $_SERVER['SERVER_NAME'] . ">" . PHP_EOL;
    	$headers .= 'X-Sender-IP: ' . $_SERVER["REMOTE_ADDR"] . PHP_EOL;
    	$headers .= "X-Mailer: PHP v" . phpversion() . PHP_EOL;
    
    	$headers .= 'MIME-Version: 1.0' . PHP_EOL;
    //	$headers .= 'Content-Type: multipart/related; boundary="' . $mime_boundary . '"';
    	$headers .= 'Content-Type: multipart/mixed; boundary="' . $mime_boundary . '"';
    
    	$msg .= '--' . $mime_boundary . PHP_EOL;
    	$msg .= 'Content-Type: text/plain; charset="windows-1251"' . PHP_EOL;
    //	$msg .= 'Content-Type: text/plain; charset="iso-8859-1"' . PHP_EOL;
    
    	$msg .= 'Content-Transfer-Encoding: 8bit' . PHP_EOL . PHP_EOL;
    

    Thanks!

  155. Thank you for a great script.
    Thanks a lot.

  156. 2004
    daryll

    is it possible to have check boxes like below

    0 ( thats a check box) red £10
    0 blue £12
    0 yellow £15

    etc

    and have the total displayed , also can this be emailed to the person filling in the form , and to me

  157. Hi Dagon.

    I added a feature to my copy. It verifies that the text field is in dollars. If you like, append the following in its respective places:

    in dd-formmailer.php:

    type=text|class=fmtext|label=Your Offer ($)|fieldname=fm_offer|max=12|req=true|ver=number

    
    /* Check for valid amount in dollars */
    function ddfm_is_valid_number($number)
    {
       // with decimal places... if(ereg('^[0-9]+\.[0-9]{2}$', $number))
       if(ereg('^[0-9]+\$', $number) || ereg('^[$]{1}[0-9]+\$', $number) || ereg('^[0-9]+\.[0-9]{2}$', $number) || ereg('^[$]{1}[0-9]+\.[0-9]{2}$', $number)){
    	 return true;
       } else {
    	 return false;
       }
    }

    
    else if ((strtolower($fs['ver']) == 'number') && ((strtolower($fs['req']) == "true") || ($t != ""))) {
    
    if (!ddfm_is_valid_number($t)) $errors[] = DDFM_INVALIDNUMBER ;
    					}
    

    in English.php:

    
    define('DDFM_INVALIDNUMBER', 'Please enter your offer amount using this numeric format <i>(no commas)</i>: 10000.00');
    

  158. 2002
    billy

    (re:2001) the problem was that i hadn’t uploaded all the necessary files and folders, all is well.

    Thank you for a great script

  159. 2001
    billy

    Hi, the following info is being displayed on the form “DDFM_REQUIREDTAG Name”, i ve tried replacing if (!defined('PHP_EOL')) define ('PHP_EOL', strtoupper(substr(PHP_OS,0,3) == 'WIN') ? "\r\n" : "\n"); but it has no affect.

  160. Is there a way to set the default of one of the dropdown options in type=select, so the HTML reads selected=”selected”? Sorry, I tried looking through the documentation and the comments but couldn’t find anything.

  161. 1999
    Omar Khan

    I am trying to run the form mailer script, Ive installed it properly and added the multiple recipients option as described in the documentation and included it in my website’s contact page but when I run it, it gives me this Error sending message!

    I am using Dreamhost currently where I have the script installed. What can cause this error?

  162. 1998
    ALS

    Has anyone figured out a fix to the attachments being uploaded with permissions of 600? They are not accessible from a web browser because of this.

  163. 1997
    Angelique

    @Joshua (comment #1987) — I had this same issue and just found a workaround. **Note that this assumes you’re using a footer.php file that calls dd-formmailer.php via an include command. It might also work in a straight HTML file, but I’ve not tested that.**

    Above my contact form, I have the following:
    <h2><a name="form"></a>Get in Touch</h2>

    I had previously been using the anchor tag #form to make sure when someone submitted the form, they were returned to the same area in the page to see the success message. But I discovered this also worked in a site where I wanted the contact form to be in every footer. I simply changed the full URL to the contact page to be that anchor tag, like so:

    // FULL URL TO CONTACT PAGE
    // If you are running this script in standalone mode, leave this blank. Otherwise,
    // enter the full URL to the page that is displaying the form
    
    $path_contact_page = '#form';

    Hope this helps you or someone else!

  164. This is a nice script..
    Its simple to learn about it..

    you have done good work.. :-)

    Thanks a lot..!

  165. 1995
    Mike

    Hi I was wondering if there is a way to add content to you email message.

    I have tried these options but no luck on the email ouput
    FULLBLOCK and HALFBLOCK

    I have added them to the form_struct var like so

    type=text|class=fmtext|label=Name|fieldname=fm_name|max=100|req=true

    type=text|class=fmtext|label=Phone|fieldname=fm_phone|max=100|req=true

    type=fullblock|class=fmfullblock|text=This could be some sort of
    introduction message.

    type=halfblock|class=fmhalfblock|text=This could be used to explain a field
    in greater depth.

    type=text|class=fmtext|label=Email|fieldname=fm_email|max=100|req=true|ver=email
    type=text|class=fmtext|label=Subject|fieldname=fm_subject|max=100|req=true
    type=verify|class=fmverify|label=Verify
    type=textarea|class=fmtextarea|label=Message|fieldname=fm_message|max=1000|rows=6|req=true

    Any help here would be very greatfully appreciated
    Mike

  166. welcome to this blog http://www.highdenimjeans.com

  167. 1993
    John Skillings

    Matt,

    Looked into the reason why script is throwing the error:

    Notice: Array to string conversion in c:\…..\dd-formmailer.php on line 315. This is in the ddfm_str_replace function.

    It appears that when you have a SELECT field with multi=true, you get the above error upon submit.

    FYI… I added the following to the default script and was able to successfully replicate the error.

    type=select|class=fmselect|label=Colors|fieldname=fm_colors|multi=true|req=true|data=Red,Green,Blue

    I am not a PHP programmer. Appreciate if you can let me know of any quick workaround.

    Thank you.

    John Skillings

  168. 1992
    John Skillings

    Matt,

    It is been couple of years since I first integrated version 5.4 of the PHP Form Mailer for a client. I start looking into an upgrade earlier this week, and ran in few problems that I think you should be aware of.

    To begin with, there is an issue with the global variables accessed in various functions. Even though a global variable value is set, the value in the function is null. Please see http://forum.joomla.org/viewtopic.php?p=2126394. After researching, I found that the way PHP5.3 handles global variables is different from the previous functions. The following additions to the code fixed the issue:

    global $form_submitted;
    global $form_input;
    global $show_required;
    global $max_file_size;
    global $verify_method;
    global $script_path;

    Next, upon submit, the script throws the following error:

    Notice: Array to string conversion in c:\…..\dd-formmailer.php on line 315. This is the ddfm_str_replace function.

    This above notice is repeated 3 or 4 times, and is not looking nice. Can you let me know the possible source of this error please.

    Thank you and looking forward to your response.

    John

  169. 1991
    John D

    The script is uploading files to our server with a permission of 600 by default. This causes me problems in downloading the images to my own pc.
    Is there anyway of forcing the uploading of the file to set permission at 766 instead of 600?

  170. 1990
    kike

    Hello,
    First of all, congratulations for this fantastic script. Well, I’m trying to apply the script niceforms-v2.0, so, I followed two simply steps:
    I changed the $path_to_css pointing to the niceforms css file
    then, I changed the form’s class attribute to niceform’s..
    And it works, but, the labels appear on the right hand side of the input boxes and I don’t really know how to fix it…
    Any idea?
    Thanks a lot

  171. While I’ve gotten recaptchs to work in IE, its introduction makes placing checkboxes or radio buttons anywhere in the form impossible to manage.

    Here’s an example:
    http://oneproductionplace.com/mainpages/contact2.php

    I’ve tried using html tags and more to correct the appearance, but the information always appears skewered. Am I missing something?

  172. Upgrading to the new form for a new site, and when the form is displayed, instead of getting a ” * “(asterisk), I get “DFM_REQUIREDTAG” displayed in red….

  173. 1987
    Joshua

    What if I want to have a contact form at the bottom of EVERY page on my site? Is this possible?

    The reason I ask is because I see this setting:

    // FULL URL TO CONTACT PAGE
    // If you are running this script in standalone mode, leave this blank. Otherwise,
    // enter the full URL to the page that is displaying the form

    So what is the actual purpose of this setting AND what if I want to place it on multiple pages on my site?

    Thanks.

    -Josh

  174. 1986
    Jacob

    I am having the hardest time I been working on trying to fit this form into a iframe and have it position relative on my website. The iframe is positioned correctly on my page but I dont know if its margins, padding, or the width and height that i got wrong but the iframe is blocking some of my html from being highlighted because the iframe is sitting ontop of some of the text around the form.

    Here is my HTML code and my CSS file

    HTML:

     		<br />
    		<br />
                    <span class="contact"> 
    <iframe src ="boyds_auto_body_contactform.php" allowtransparency="true" position="absolute" width="550" height="600" frameborder="0" scrolling="no"></iframe></span>
    		  <br />
                      <br />

    CSS

    
    }
    
    .contact {
    	position: relative;
    	left: 300px;
    	top: -1125px;
    }

  175. Hi all,

    I guess this is my day for questions, so here goes.

    First Question:
    I noticed that in an implementation using an “include”, after my custom thank you page displays, when I hit the back button a completely filled out form reappears and I can resubmit the form again and again.

    I’ve tried to implement cache-control but with no positive results. I can see some hacker deluging my client’s in box with bogus forms.

    Second question:
    Has anyone figured out how to show a customized error page if a required field is missing, instead of the generic one with no styling at all, when using an “include”?

    Thanks for your help.

    Best,

    Jerry

  176. Hi all,

    I’‘ve set up the selrecip field with a series of questions and appropriate e-mail addresses (not always different). Something like this:

    type=selrecip|class=fmselect|label=Recipient|data=(select),Thinking of joining but need more information?,email1@domain.com,Need help with your password?,email2@domain.com,Questions about an exhibition?,email3@domain.com,Want to Volunteer?,email1@domain.com

    I’d like to be able to pull the question being asked from the selrecip field and include it as the subject line of the sent e-mail, so the sender won’t have to fill out a separate “subject” field.

    I’ve tried a number of solutions and looked though all the posts but I can’t figure it out.

    I’m running the current formmailer version.

    Any suggestions?

    Thanks,

    Jerry

  177. 1983
    A. Girl

    Is there a way to have the “Thank you.” page linked to a customized page? Also, when someone doesn’t fill in a “required” field, there is the generic page, but I want it to go to a customized page. How can I do these things? Please help.

  178. I’ve just upgraded scripts to Version 5.8…and now the verification code fails in IE 7.0.5730 on a number of sites. Works fine in other browsers.
    Example: http://viaelisa.com/via_elisa_contactnew.php

  179. 1981
    karlogann

    Hello, is it possible to have the script save the data to an xml file or send the xml file per email?
    Gretings, Karlo

  180. 1980
    harry

    i am using the standalone version
    when i send a message on the form i get the error messages

    DDFM_errormsg
    DDFM_novergen

    how to fix that?

  181. 1979
    Pascal

    Are you still updating it?

  182. To make the name required, you would just have to add a check in the code, to not allow blank names. Look for the text “only the message is required. to require others, add checks for them”. It shows that on the message check. Just duplicate that line for the name field.

  183. To make search engine familiar with our sitemap, everything running well and there’s no problem. really easy to use and very recommended.

  184. 1976
    John

    First of all, thank you for your work on this script. I’m having the same issue as Ian (commment #1966). Whenever I or anyone tries to submit the form, the form reloads without any formatting. The form is not running standalone.

    This problem began when my hosting company updated from PHP4 to PHP5. Is there something I’m missing that needs to be changed for dd-formmailer to work with PHP5? I did the small PHP file to test the PHP mail function and it arrived perfectly.

    Thanks to anyone that can offer any help.

  185. 1975
    claudia

    When you use the script, do you reduce everything you do not need? In my script the code is 2000 rows long. I would like to use the formmailer on different pages with different modifications and i have to insert the scriptcode in existing sites. it is so confusing and i don’t know if there is a error of reasoning.
    Maybe some other users have a clue, what is wrong and how i could reduce the code to a minimum.

    Thank you!

  186. 1974
    Kat

    Hmm, I provided a solution to a problem that several people expressed (how to redirect different forms on the same site to different URLs) – and while my comment initially showed up, it seems to have disappeared.

    Don’t know why a positive, helpful solution-oriented comment would be wiped out. And what does deleting such a post communicate about how helpful comments intended to help the community are valued?

  187. Would be great if there could be multiple instances on non wp version.

  188. 1972
    Josephine

    Hi

    No matter what I set the max widetext value to be, I keep getting an error for characters allowed.

    This is what I have now and even when I know I don’t have 4000 characters, including spaces, I still get an error:

    type=widetextarea|class=fmtextwide|label=Story idea|fieldname=fm_storyidea|max=4000|rows=10|req=true

    Anything I’m doing wrong?

    Thanks!

  189. 1971
    ERiK

    what if one wants a drop down list of different email addresses/names to chose whom the email from the form is sent to? how would that be coded? i’d be a newbie and don’t know how and cant find it on the web.

  190. i was wondering how to add a drop down box and have users select an email that the message in the form would be sent to? i’m a php newbie and have the form working fine but need to know how to do the above.
    if you can help it would be greatly appreciated.

  191. Hi,
    I am trying to display a link in the $sent_message output and can’t seem to figure it out.

    I have setup an auto redirect after the message has been sent but also want to display an alternate link just incase the redirect does not fire.

    Here is the code I am working on:-

    
    $sent_message.= '<p>You will be automatically re-directed to my Home Page in 5 seconds.</p>';
    $sent_message.= '<p>Alternatively, please click '.<a href="http://www.my-domain.co.uk">.'here'.</a>.'.</p>';
    

    Any help would be appreciated.

    Regards..,

    MT

  192. Man, I really like this plug-in — it makes form design and management very easy.

    SEO Manchester

  193. Been using this form for a while now and even though I have no PHP knowledge I was able to make almost everything work as the design dictated, but the designer is requiring me to use a rollover image for the button and although I’ve tried a couple of things it doesn’t seem to work for the rollover.
    I tried a bit of jQuery :

    <script type="text/javascript" charset="utf-8">
        $(document).ready(function(){
            $('#submit').hover(
                function(){ // Change the input image's source when we "roll on"
                    $(this).attr({ src : 'submit_over.png'});
                },
                function(){ // Change the input image's source back to the default on "roll off"
                    $(this).attr({ src : 'submit_off.png'});             }
            );
        });
    </script>
    

    and made the change to the submit code where input type is changed from submit to image and included the source src=”" but still having some trouble.
    So I tried to make a background image inside the css with a hover effect for the text only and found that using this method I loose the fancy little hand which the jQuery provided.
    Has anyone on here made an image rollover for the submit button?

  194. 1966
    Ian

    I’ve spent a couple of hours on this thing and it displays fine.. the problem is it just reloads new every time the submit button is hit.. like the post values aren’t being picked up by the handler part of the script.

    I use a get system to display my pages such as index.php?p=contact etc..

    Is there an issue with this? I’m not using standalone.. the form posts variables so it hould act lie any other form.. yet it doesn’t get picked up when handed toitslf.. is there a line missing from the beginning of the script such as an if $_post exists etc? I notivce its half way through..

    Thanks in advance

  195. 1965
    Yakiv

    Still hoping for some help on this one:

    http://www.dagondesign.com/articles/secure-php-form-mailer-script/comment-page-130/#comment-507590

    By the way, your link to the comment about HII does not work. It doesn’t go to the appropriate comment. …Mine (above) may not work either, but the point is, #comment-507590 or probably better:

    1939
    Yakiv
    3-8-10 1:30PM

    on page 130.

  196. 1964
    Jason

    If I am not using the standalone option and including the form on a separate contact.php page how do I include it? do I copy all of the script onto that page or do I use an include?

  197. Thanxs very much, I am going to have a look at this and probably use it for my next website.

    SEO Manchester

  198. Very well! Good post!!

  199. Very important information!

  200. 1960
    Jacob

    I’m trying to get the form to redirect to a different page after it has been submitted, but only if a certain field is selected on the form. Basically I want to redirect people to a credit card processing page depending on which registration type they selected. So if a certain radio button is selected it would redirect them (after form submission) to the page to take their credit card for that particular registration type.

    Any ideas? Thanks!

  201. You are rights!

  202. I yave work form…

  203. if you work with html – used form include

  204. Used php…

  205. Script work with html?

  206. Wery well!

  207. Yes… script is shared…

  208. Good varint!

  209. Hi! You site in my favorits!

  210. Thanks for shared info! I can`t find it net.

  211. How it work. I have problem in use.

  212. Good luck! You are the best!

  213. Thanks! Good luck!

  214. Thanxs very much i am gonna have a look at this and probably use it for my site
    am testing it atm but it seems that cc or multiple to dont work for me
    i use

    $recipients = ‘to=me1@domain.com|to=me2@domain.com’;

    but only get the 1st one

    can it be something my provider blocks or m i doing something wrong

  215. A few people mentioned problems with the date chooser field type. I tested this out thoroughly, and it seems to be functioning fine. Just be sure (if you are using the PHP version of the script) that you are including the required javascript file.

    As always, I am not able to implement every single requested feature, but I try to focus on known issues, while implementing things that many can benefit from.

  216. I have managed to get my recaptcha image to show now but am having trouble to get input in my new fields accepted. Please could you advise.

    Many thanks

    Julian

  217. Thanks!Great article!

  218. thanks super

  219. 1941
    Gillian

    If I want to send the data inputed into this form to a database where would I put the file so that I can send the data when the user submits the form?

  220. 1940
    Suzy

    Regarding my previous comment: 1896, DaveP’s comment: 1926 and Eric’s Comment: 1912:
    I did finally get the .csv files to work when not in standalone mode with version 5.8 (not with earlier versions). The instructions state “With the PHP version of this script, the path to the data file is relative to the location of the script. Be sure to give this file write access.”

    Even if the script and the .txt or .csv file are in the same folder (ie: dd-formmailer), just using $save_path = 'form-messages.csv'; did not work. The relative path that finally worked for me was:
    $save_path = './dd-formmailer/form-messages.csv';

    I am not sure if this worked because the .php file that was including the dd-formmailer.php script was outside of the dd-formmailer folder, but anyone who is trying to include the form in their own .php page should try using a path in the same format as above.

    As for write access to the .csv or .txt file, the lowest file permissions I could set and still have the file written to by the script was 722.

    I hope this helps anyone who is still pondering over this function.

  221. 1939
    Yakiv

    Has anyone used an alternative captcha – called HN CAPTCHA – with this script? I absolutely love this contact form. It is one of the best on the internet. The captcha is quite good, but I have wished I could use HN CAPTCHA, which I use throughout my sites. Here’s a direct link to the project, in case anyone does not know about it:

    http://hn273.users.phpclasses.org/browse/package/1569.html

    Hope maybe someone can help with this. I did see the code for HII and thought about trying to pick away at it to get it work with HN CAPTCHA, but if someone has already done it and can graciously contribute the code, I would be grateful! Thanks!!

  222. I am having problems getting the Recaptcha image verification object to appear on my form page, having followed your troubleshooting advice. I have entered the keys that I got from signing up for this. Please could you advise.

    Otherwise I am very impressed with this program.

    Many thanks

    Julian Yorke

  223. Great article , been looking for this type of detail

  224. hello sr ki haal hai

  225. 1935
    sims

    Oh, they paginate after they all load… almost pointless…

  226. 1934
    sims

    It might be a nice idea to paginate the comments. This page takes forever to load. When it does load, it takes up so much memory and some text can’t even be displayed.

  227. 1933
    John

    Script works great. Thanks. However, the reply-to email in the emails I receive from the form displays my default server email address (e.g username@box#.servername.com). I would like to have the reply address display the email the users enter in the form field. Whats the best way to make this happen?

    THANKS!

  228. First of all thank you for the awesome script! It was the only one I found that would work with yahoo hosting. Secondly, I wanted to use this script on a different page, without making it standalone so I put it in an iframe and of course it didnt line up correctly, however it did send email. So then I spent the rest of the day trying to edit the css. NO GO! So I had to find a workaround for this problem. Literally half the form wasn’t showing up in the iframe for some reason. For those of you who just want to pull this php form into a regular html page so you don’t have to hassle with editing the script or the css here is the workaround for it. YEAH! I hope this helps save you hours!!!

    <div style="
       clip: rect(0,381,381,0); // right-clip equal to div width plus total border width
                                // bottom-clip equal to div height plus total border height
       position:absolute;       // used for positioning and may or may not be required
       background: #FFF;        // background color of div may or may not be seen
       height: 500;             // height of window (div) that contains the iframe content
       width: 377;              // width of window (div) that contains the iframe content
       left: 125;                // absolute position of window (div) from the left edge of browser
       top: 100;                 // absolute position of window (div) from the top edge of browser
    ">
    
    <iframe 
       src="your_full_url_where_you_uploaded_dd-formmailer.php" // location of external resource 
       width="600"              // width of iframe should match the width of containing div
       height="600"             // height of iframe should match the height of containing div
       marginwidth="0"          // width of iframe margin
       marginheight="0"         // height of iframe margin   
       frameborder="no"         // frame border preference
       scrolling="no"          // instructs iframe to scroll overflow content
       style="
          border-style: solid;  // border style
          border-color: #333;   // border color
          border-width: 2px;    // border width
          background: #FFF;     // background color
    ">
    </iframe>
    
    </div>

  229. 1931
    John

    Any way to have form elements side-by-side?

    Thanks

  230. 1930
    Neil H

    In FORM STRUCTURE I would like to use a fully formated, multi line message for fm_message but I can’t seem to get default= to work other than a short default message. Is it possible to pull a formated message from a file or do you of any other work around? Thanks

    type=textarea|class=fmtextarea|label=Message|fieldname=fm_message|max=5000|rows=35|req=true|default=Regular message goes here.

  231. 1929
    Luc

    Hi there. In the instructions it’s specified that each words that can be seen in the form have been translated in the language files.

    I see that nobody pointed that out yet (how come ? ) but the labels, like for example “Name” in the form is not translated at all, nor are the other ones. the only one translated is the “Send” button value.

    I added to my language files

    
    define('DDFM_NAME', 'Name');
    

    and want to use it instead of “Name” in the following code:

    
    type=text|class=fmtext|label='DDFM_NAME'|fieldname=fm_name|max=100|req=true
    

    I tried numerous options and it doesn’t work.

    Anyone can help ?

    Thank you

  232. hello
    really good script
    however is it possible to make users type(Input by themselves) the recipients email address instead of giving them choices from already fixed lines of emails to choose from a list

  233. 1927
    Jozsef

    With $standalone = FALSE; is there any way to do any kind of changes with Error page I’m getting if I don’t fill all required fields? Or, is there a way of having custom Error page for this thing?
    Thanks.

  234. 1926
    DaveP

    I cannot get any data written to a data.txt file in the same folder as I have the scripts, full write permissions exist. This has been raised before but I could not see a solution for it -Does anyone have one please?

    // SAVE DATA TO FILE
    // If set to TRUE, the form input will be saved in a delimited file

    $save_to_file = TRUE;

    // STILL SEND EMAIL
    // If saving the data to a file, still have the script send the email?

    $save_email = TRUE;

    // DATA PATH
    // The file that will be written to – make sure it has write access

    $save_path = ‘data.txt’;

    // DELIMITER
    // Fields will be separated by this character. If this character is found in
    // the actual data, it will be removed.

    $save_delimiter = ‘|’;

  235. iv tried to do my form in the $manual_form_code part but for some reason none of the data is in the email when i receive it ?

    i made the form in $form_struct first which works but when i copied the html code in the manual part no joy !!!

    dose any one have any idea on why !
    this is page here
    http://www.mediacake.net/client/open4ed/order2.php

    thanks

  236. I have implemented this script twice now, the first is at:

    http://richardloosassoc.com/contactus/

    The newer one is at:

    http://starmarineservice.com/starmarine_contact.php

    I’m having a strange problem that I was hoping someone might have a clue about how to solve.

    When you view this new site with MSIE 8, when you click on the form field under the name tag, it doesn’t bring focus to the field. You have to click on the name tage, or any text tag associated with it’s particular form field.

    The first site works perfectly. I have gone through the code with a fine tooth comb and can’t find any major differences. On the first site, I cut and pasted the code right into the page. On the new site, I added it as a php include.

    I thought about simply writing in a statement to bring focus to the first element but the truth is, that wouldn’t really work because when you have focus on the form field and click the form field, it loses it’s focus.

    Weird problem, any thoughts?

    http://www.starmarineservice.com/starmarine_contact.php

  237. 1923
    Josephine

    Thanks, Paul!

    I’m going to try the code change for the submit button tonight.

    Jo

  238. 1922
    Paul

    LUST -

    Would using a redirect tag work to meet your needs?

    <META http-equiv="refresh" content="5;URL=relative_or_absolute_path_to_redirect_to">

  239. 1921
    Paul

    Eric -

    I think that the .csv file and the .php file need to have the same owner. Make sure that what ever user account owns the .php file owns the .csv file as well.

  240. 1920
    Paul

    Josephine: (I forgot to use the

     in my first post)
    
    Look for this line and edit:
    <code>			
    //$o .= '<div class="submit"><input type="submit" name="form_submitted" value="' . DDFM_SUBMITBUTTON . '" /></div>' . "\n\n";
    

    I wanted to do the same as you did…here is my modified line:

    			$o .= '<div class="submit"><input type="submit" name="form_submitted" value="Submit Proposal" /> <input type="reset" value="Clear Form" name="clear_form"></div><p></p>' . "\n\n";
    

  241. Josephine:

    Look for this line:

    //$o .= ” . “\n\n”;

    I replaced it with this in my code to do just what you wanted to do:

    $o .= ‘ ‘ . “\n\n”;

  242. 1918
    Josephine

    If I want to change the button that says Send Email to say Enter Contest, where would I find that on the script and how do I do it?

    Thank you.

  243. 1917
    yaron elh

    the third problem I came across while trying to build a form, as I wanted to use an image instead of a submit button.

    So first thing I tried is just to change the input type from, input type submit to input type image.

    And Which that worked perfectly in all browsers except Internet Explorer, but technically this time Internet Explorer is on the right side of things.

    Well I’ve found a solution for this, if you want a submit button as an image, first you need to change the submit type to image.

    The second thing you need to change this line of code.

    
    if (isset($_POST["form_submitted"])) {
    

    To this one.
    
    if (isset($_POST["form_submitted"]) || isset($_POST["form_submitted_x"])) {
    

    It worked for me, hope it help someone I’ve seen it appear on the posts several of times, but nobody really bothered comeback and submit the Solution. so in the spirit of open source here you have it.

    And many thanks to developer for an excellent script.

  244. 1916
    yaron elh

    improvement suggestion

    Sometimes you would want to use this, as a quick form in every page of your website.

    This code will detect the page you were in

    
    function curPageURL() {
     $pageURL = 'http';
     if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
     $pageURL .= "://";
     if ($_SERVER["SERVER_PORT"] != "80") {
      $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
     } else {
      $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
     }
     return $pageURL;
    }
    
    

    then instead of hard coding a static URL in the
    $path_contact_page

    you can use this code
    $path_contact_page = curPageURL();
    (You can put the previous code above it)

    and it will assign the current page dynamically

    note: this code did not work for me in a local server.
    only on a remote server it obtains the URL correctly.

  245. 1915
    yaron elh

    if someone wants to send characters in utf-8 correctly in the subject field of the mail,

    currently the code has one method of doing which didn’t work for me so this is another method, and it displays the subject field correctly for me.

    The lines

    
    $headers .= 'From: ' . $sender_name . ' <' . $sender_email . '>' . 
    PHP_EOL; 
    $headers .= 'Reply-To: ' . $sender_name . ' <' . $sender_email . '>' . PHP_EOL;
    $headers .= 'Return-Path: ' . $sender_name . ' <' . $sender_email . '>' . PHP_EOL;
    

    should be replaced with:

    
    $headers .= 'From: =?UTF-8?B?' . base64_encode($sender_name) . '?=' . ' <' . $sender_email . '>' . PHP_EOL;
    $headers .= 'Reply-To: =?UTF-8?B?' . base64_encode($sender_name) . '?=' . ' <' . $sender_email . '>' . PHP_EOL;
    $headers .= 'Return-Path: =?UTF-8?B?' . base64_encode($sender_name) . '?=' . ' <' . $sender_email . '>' . PHP_EOL;
    

    further the code you have more lines

    
    $headers .= 'MIME-Version: 1.0' . PHP_EOL;
    $msg .= 'Content-Type: text/plain; charset="utf-8"' . PHP_EOL;
    

    should be replaced with this one

    
    $headers .= 'MIME-Version: 1.0' . '\r\n' . PHP_EOL;
    $msg .= 'Content-Type: text/plain; charset=UTF-8' . '\r\n' . PHP_EOL;
    

    now the last thing you have to do is comment out, the previous suggested fix For forgets that is present in the source.

    comment this section out:

    
    if (function_exists('mb_encode_mimeheader')) {
    	$email_subject = mb_encode_mimeheader($email_subject, 'UTF-8', 'q', '');
    	$sender_name = mb_encode_mimeheader($sender_name, 'UTF-8', 'q', '');
    	}
    

    this fix is based on
    http://bitprison.net/php_mail_utf-8_subject_and_message

    and I implemented it in the code

    Hoping helps someone

  246. 1914
    jph

    looks awesome…. but having trouble using gmail servers, requires SSL. I put in the following code, but it doesn’t seem able to deal with an SSL connection? Ideas?

    
    //following chunk taken from http://www.dagondesign.com/articles/secure-php-form-mailer-script/#installation as suggested replacement
    ini_set("SMTP","smtp.gmail.com");
    ini_set("smtp_port","465");
    ini_set("username","xxxxx@gmail.com");
    ini_set("password","xxxxx"); 
    ini_set('sendmail_from', $sender_email);
    $send_status = mail($send_to, $email_subject, $msg, $headers);
    ini_restore('sendmail_from');	
    	
    	//@ini_set('sendmail_from', $sender_email);
    	//$send_status = mail($send_to, $email_subject, $msg, $headers);
    	//@ini_restore('sendmail_from');
    
    	return $send_status;
    

  247. I am having an issue with a long delay/hang, 30-60 Sec. after a form is sent and then goes to the thank-you page.

    Jeremy

  248. I love this script and will be donating soon ! You deserve it for all your dedication and hard work on this. The website addy above is under construction.

    I’m having a small issue with the following code…in standalone mode.

    // SAVE DATA TO FILE
    // If set to TRUE, the form input will be saved in a delimited file
    
    $save_to_file = TRUE;
    
    // STILL SEND EMAIL
    // If saving the data to a file, still have the script send the email?
    
    $save_email = TRUE;
    
    // DATA PATH
    // The file that will be written to - make sure it has write access
    
    $save_path = 'data.txt';
    

    As you can see I’ve changed the values to TRUE for the save_to_file and kept the email function of the script but when I attempt to have the data written it does not write.

    I’ve chmod 777 for the data.txt file and even attempted to specify a CSV file instead of a txt file but the script is not writing to the file.

    I also have attempted to change the permissions on the main directory for 777 but that prevents the script form running properly.

    If you could post some more info about the save_to_file feature I’m sure many of us would benefit from it.

    Thanks!

  249. hi boys,
    I wants a script for mail if you have send me plz at waji.lala@gmail.com i can not make himself

  250. I like the script. Thanks for the secure php form mailer script.

  251. Thank you so much for the sharing.

  252. 1908
    HTML

    Stupid comment form didn’t show the HTML table structure I used… I’m sure you all know your basic table tags… or do you?

    http://www.w3schools.com/html/html_tables.asp

  253. 1907
    HTML

    Sending messages in HTML format is possible by changing the Content-Type from text/plain to text/html.

    Before:
    $msg .= ‘Content-Type: text/plain; charset=”utf-8″‘ . PHP_EOL;

    After:
    $msg .= ‘Content-Type: text/html; charset=”utf-8″‘ . PHP_EOL;

    Now all you have to do is edit the $message_structure to something like this:

    $message_structure = ‘

    Business Name:

    fm_bname

  254. 1906
    Catherine

    Is there a way to set the permissions of the actual files that are being uploaded (with the save attachments option)? Right now they’re defaulting to 600.

  255. 1905
    Dean Wild

    Hi I have just installed the Form Mailer script into a website I have designed. I have added the Javascript date chooser however I have noticed that when the form is sent the E-mail I recieve does not include the date that has been entered or chosen. :( Any idea how to fix this? Thanks

  256. 1904
    Rita

    Hi again,
    After some work the error is gone but I get this error and message will not go through.
    Method Not Allowed
    The requested method POST is not allowed for the URL /contact-us.html.

    Tried to test using this script

    The message will go through and receive it. So the server not at fault and I can’t see any misconfiguration script.
    Any help will be very much appreciated.
    Rita

  257. 1903
    Rita

    Hi all
    I get this error:
    Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /homepages/13/d302728987/htdocs/contact/formmailer.php on line 159

    Any help will be appreciated.
    Thanks
    Rita

  258. 1902
    Rob

    Fatal error: main() [function.require]: Failed opening
    required ‘lang/English.php’ (include_path=’.:/usr/lib/php’)
    in /homepages/13/d302728987/htdocs/contact/dd-formmailer.php on
    line 249

  259. 1901
    Lust

    Anyone know how to make it redirect straight to a page and not after it refreshes the same form page?

  260. Okay, now I know that at the free service plan that I have with my host I will not be able to send email. It is funny how I thought I paid for something by purchasing a domain name, just not the monthly service. Perhaps then the answer to my question below is obvious?

  261. So far so good. The form appears on my site and I like it. The one thing that I have not yet found out yet is if I am able to submit email via my host server, which I understand will be a sepparate issue. But if my host server is not the issue, then what might cause the dd-formmailer.css to load after I have clicked the send e-mail button on the form? Currently after I click the send e-mail button the blank dd-formmailer.css page loads.

  262. Great tool! Installation is almost instant :D

  263. 1897
    Suzy

    Just noticed a typing error in my last Commment (1896). The full url path that I have tried in the $path_contact_page line is in the format of: http://www.mydomain.com/filename.php
    Thanks again for any advise you can offer.

  264. 1896
    Suzy

    PAUL (Comment 1880) regarding my earlier comment (1847). Thanks for the suggestion Paul. All files relating to dd-formmailer have the same owner and I have set the necessary file permissions to 777 or 755.
    With some further testing, I discovered that if the script is installed as a standalone option, the messages are posted to the csv file. If I set the standalone option to FALSE but leave the $path_contact_page blank, the messages still populate the csv file. I would like the submission message to be returned in the .php file that calls the dd-formmailer.php script. For this to work, I must put a path in the option $path_contact_page. I have tried using a relative path to dd-formmailer.php, a relative path to the .php page calling dd-formmailer.php and also tried the full url from http:www.mydomain.com/ etc. As soon as I enter any path in $path_contact_page, the messages no longer populate the csv file.
    My php coding knowledge is VERY limited and I do not know if there is an error in the code relevant to $path_contact_page or if there are additional optional settings I should have used to make the script work when being called in a separate .php file.
    Any advise would be appreciated. It’s a great script and I don’t want to give up on it yet! Many thanks.

  265. 1895
    Stan

    I installed the latest version (5.8) script with basic image verification. Works fine in Firefox, but Internet Explorer gives me this error:
    “No verification code generated”.
    I triple-checked everything, and since it sends email in Firefox, I have no idea what the problem might be.
    Any ideas?

  266. Hi, I have problem with: á é í ó ú ñ

  267. 1893
    Paul Söderholm

    I have the same problem as mentioned in comment 1862: Special characters (for example umlauts) in Subject and From are garbled, but looks OK in the message. Help, anyone?

  268. How would I pass a value to the form so I can put an email link to one of the multiple recipients… so when someone clicks on the link, they go to the contact form and either that particular person’s name is selected in the dropdown box… or the name is echo’d to the form as text… signifying who the recipient will be upon submittal?

    Recipient Name

    Please help.

  269. Unbelievable script! Thanks so much – installed and modified without a hitch! Will make a donation very soon to support your excellent work.

  270. 1890
    nknk

    hjkk

  271. yes i know

  272. 1888
    Emil

    When I receive the email it shows the information like this:

    NAME: John Smit

    EMAIL: john@mail.com

    MESSAGE: This is my message

    There is too much space between lines, there is two there
    My question is how I can eliminate one ?

  273. 1886
    Paul

    DDFM-REQUIRED_TAG – I also had these showing instead of the asterisks and couldn’t figure out how to fix it. I copied my form field declarations to a clean version of the formmailer.php file and it fixed the problem. Apparently I may have either inserted or deleted a character in the PHP code somewhere. If you’re having this problem try what I did.

  274. 1885
    Paul

    MIMI (comment 1829) – did you get the attachment feature to work? (I saw you had it implemented on your contact form, so you may have – or you may be using a different script for your contact form.) If not, did you define this: Save attachment path – Where files will be saved, if attach_save is enabled. This is the full path on the server, with a trailing slash. Directory must have write permissions. Example: /home/user/public_html/uploads/ Also, I’m not sure but your upload directory and formmailer PHP file may need to be owned by the same user.

  275. 1884
    Paul

    VINCENT (comment 1843) – why would you want to leave the form and go to a custom error page? The second part of your question (having contextual error messages) would be highly usable. I think you’d have to find where in the PHP code the error messages are generated and change it from displaying the errors in DIV tags to looping through re-generating the form with contextual error messages (error messages next to the field with the error). Good luck!

  276. 1883
    Paul

    RUI (comment 1837) – you can’t display a hidden field…it’s HIDDEN :-) However, you may be able to tweak the code that generates the email message and manually add the hidden field to the generated email message. You’d probably have to create a new ‘case’ for hidden fields. Don’t ask me how, but anything can be done.

  277. 1882
    Paul

    MICHAEL (comment 1857) – I read in another post (way earlier) that the message can’t be sent in HTML format

  278. 1881
    Paul

    MATT (comment 1876) – your language file may be corrupt, try downloading again and extracting the language file and copying it to your directory.

  279. 1880
    Paul

    SUZY (comment 1847) – I think the that your CSV file and formmailer PHP file need to have the same owner as well. I’m not positive, but it’s worth a try

  280. 1879
    Paul

    I found an old post that addresses my issue in comment 1870…the fieldname must be name fm_xxxxxxx with no caps or special characters after fm_

  281. 1878
    Mr Ree

    Let me try this again….

    How can I add a message on the top of the form page that goes away when the message is sent? In an older version I found this

    $form_structure = array(
    “openfieldset|fmset”,
    “info|fminfofull|Text here
    but on the latest version, I cant find it.

  282. Ref post 1876 – Click on test link under “Special Announcements” to see visual of last post. Apparently the asterisk and submit buttons aren’t getting translated.

    Thanks!

  283. 1876
    Matt Lewis

    Great script just having a small problem. Unable to get script to read language file. Have uploaded the English.php into folder named “dd_formmailer” in my server’s root directory. Set path to /dd_formmailer/English.php and get DDFM_Required_TAG errors for all the basic fields. Seems like the path is correct, but can’t figure out why. Names of field do appear next to the filed boxes. Help please – read through your discussion forum, but don’t see same issue/solutions. Thanks for the effort!

    Thanks!

  284. great script but i dont work it. please help me

  285. 1874
    duffy6

    Hi!

    Is it possible to attach the uploaded file to the auto reply mail?

    regards,
    duffy6

  286. Great Script. Easy to follow for a novice like me. Thanks so much!!

  287. .. and where do i increase the way to tiny VERIFICATION CODE (basic) within the latest script versions (the older scripts had a separate file for that)……???

  288. I see postings 28 & 29 but these must be for a previous version of the script because I do not find line referred to by Dagon Design Admin. I figure I need to define the variables for my new form fields so that the data therein will be passed through to the email but don’t know where in the PHP to do this. Any assistance is appreciated. Thank you.

  289. None of the form fields that I add are passing the data through to the email. If I use the forms fields that come with the script the data in those fields come through in the email that generated…but not any new fields that I’ve added. Why?

  290. 1869
    Dave

    I get this in front of every field why ???
    DDFM_REQUIREDTAG
    Also where is form structure, I need to get rid of one field only….

  291. got it working… just in case anyone else runs into this issue:

    
    $auto_reply_message = 'some text' . "/n";
    

  292. 1867
    vv

    I’m trying to figure out how to put a line into auto replay.
    The following attempts don’t work for me.

    
    $auto_reply_message = 'some text';
    $auto_reply_message .= /n;
    $auto_reply_message .= 'some text';
    
    $auto_reply_message = 'some text';
    $auto_reply_message .= '<br />';
    $auto_reply_message .= 'some text';
    
    

    Any suggestions are appreciated.

    Thanks!

  293. 1866
    Mster Ree

    Let me try this again….

    How can I add a message on the top of the form page that goes away when the message is sent? In an older version I found this

    $form_structure = array(
    “openfieldset|fmset”,
    “info|fminfofull|Text here
    but on the latest version, I cant find it.

  294. 1865
    Graham

    Re my earlier post 1860
    Fixed it!

    added this line to $form_struct
    type=text|class=fmtext|label=Unit Type|fieldname=fm_type|max=100|default=’.$_POST['unit_type'].’

  295. 1864
    Graham

    Ref pots No1859

    Ree can’t you use a FULLBLOCK adding this to top line of $form_struct ?

  296. 1863
    Emma

    Has anyone used google conversion tracking with the wordpress version of the form mailer? I am struggling to see where I should insert the google conversion tracking code in the “dd-formmailer/dd-formmailer.php” file. Any help will be greatly appreciated.

  297. Is there anybody still answering any of our questions at all???

    I discovered an UTF-8 encoding error in this script and i’d like to fix it.

    In the FROM output
    (Example:From:
    “Rädölf Ãberläufer”
    the NAME is not UTF-8 encoded (while it is in the body section of the email).

    Suggestions anyone pa-lease???

  298. 1861
    Graham

    I’m having trouble using a variable passed to the form.
    I am trying to use it as a ‘default’ value in a form element or adding to $email_subject. The variable is being passed ok but how can I use it within the form itself?

  299. 1860
    Ree

    How can I add a message on the top of the form page that goes away when the message is sent? In an older version I found this

    $form_structure = array(
    “openfieldset|fmset”,
    “info|fminfofull|Text here
    but on the latest version, I cant find it.

  300. 1859
    Ree

    How can I add a message on the top of the form page that goes away when the message is sent?

  301. Hi I can’t get any error messages to show – So whatever I type in the fields still sends the form through, but I can leave out fields & won’t repost an error .. Any ideas please????

  302. 1857
    Michael

    Is there anyway to use html in the message template?

    When I use html code i.e I dont see the html in the email only the actual html code.

  303. how can i insert a line break to the checkbox options – so that each option ticked shows up on a separate new line in the email output??

  304. 1855
    John H

    Hi, Love the script, massive help to me so far!

    Can you help me with populating a select field?

    I am using the standalone version, and trying to prepopulate a dropdown box with options from a mysql database. I cant figure it out at all???

    Thanks in advance!

  305. 1854
    John H

    For those of you who are trying to get the standalone version to update a table on a mysql database, after loads of searching and playing I have got it to work like this. I added this code:

    $con = mysql_connect(“host”,”user”,”password”);
    if (!$con)
    {
    die(‘Could not connect: ‘ . mysql_error());
    }

    mysql_select_db(“dbname”, $con);
    $sql=”INSERT INTO tablename (fm_firstname, fm_lastname, fm_email, fm_etc, fm_etc)
    VALUES
    (‘$_POST[fm_firstname]‘,’$_POST[fm_lastname]‘,’$_POST[fm_email]‘,’$_POST[fm_etc]‘,’$_POST[fm_etc]‘)”;

    if (!mysql_query($sql,$con))
    {
    die(‘Error: ‘ . mysql_error());
    }

    mysql_close($con);

    after this bit:

    $o .= ‘‘;

    } else {

    in the script around line 1750 ish.

    Not sure if its the best way to do it, but I found that it wont update the db unless the form is filled in correctly, which is what I wanted.
    Hope this helps.

  306. 1853
    yamiza

    The script is not working, I’ve checked everything and it seems alright… It won’t send the e-mail to me.

  307. IMAGE SUBMIT BUTTON

    Trying to replace the submit button with an image, working fine in FireFox, Opera & Safari, but no luck in IE. Any suggestions?

    <input type="image" src="/images/btns/submitRedBtn.gif" name="form_submitted" value="SUBMIT" alt="SUBMIT" class="button">

  308. Is there any way to style the input box (in FF) for the Browse button: input#fm_upload.fmfile? If I could just make the borders plain black 1px lines, even that would help.

  309. Sure, I can have fun drinking, but I need a place to walk and hike and get away from cement. ,

  310. Preparing your postsThere are four ways to post content to Posterous. ,

  311. The certain and possible losses associated with unilateral and multi lateral political actions need to be examined. ,

  312. 1847
    Suzy

    Has anyone managed to get the form fields to save to a data file? I have tried using a .txt file and a .csv file with 777 permissions but no fields are populating. The $save_path = ‘data.csv’; is relative to the dd-formmailer.php file. I have set $save_to_file = TRUE; and $save_email = TRUE; I have not modified anything below ** END OF OPTIONS. Can anyone give me any advise or tell me if I am missing anything? Thanks.

  313. What about Autowin Book Club? ,

  314. 1845
    Jax

    I’m getting an error that reads:

    Warning: mail() [function.mail]: SMTP server response: 553 sorry, your mail was administratively denied. (#5.7.1) in D:\Hosting\3043566\html\wp-content\plugins\dd-formmailer\dd-formmailer.php on line 496

    Where exactly is line 496?

  315. I have been using this plugin for a few months without problem, but now users are getting the following error message when submitting forms: “No verification code generated”. I would be appreciative if anyone can assist with info to help fix. Thanks in advance.

  316. Hi guys, anyone found a solution yet for linking to a custom errorpage? or even better staying on the same page as the submit form but highlighted the error fields?

    Highly appreciated

    Vincent

  317. 1842
    Steve

    Firstly this is a great script and easy to set up for normal implementations.

    One observation regarding the advice above to change “_POST” to “_REQUEST” to prepopulate fields – my reading of the script is that this won’t work even if values are passed in the query string because it only populates data into the form if the “$form_submitted” variable is set, so it needs some tweaks elsewhere in the code too. (At least that’s what I found on my install but I might be missing something!)

  318. I noticed from your script that i just now downloaded that you have incorporated UTF-8 encoding into the forms message fields.

    However, the Subject line is not coming out in UTF-8 as i just tested with some German letters.
    Where in the script would i have to add what lines of code to also turn the subject line output into UTF-8 format?

  319. 1840
    Patrick Quirke

    I need a the reply message to display what checkboxes the user have checked, how can i do this?

  320. Vielen Dank für diesen Vorschlag. Ich schicke Dir einen Gruß aus Deutschland.

  321. Vielen Dank für diesen Vorschlag. Ich schicke Dir einen Gruß aus Deutschland.

    Thanks for the suggestion. I send you regards from Germany.

  322. 1837
    Rui

    Hello thank for this lovely piece of code. How can I display a hidden text field

  323. Great script. I am helping re work a community web site http//:www.wings.net.nz and downloaded and tested your script using both basic and recaptch verification within minutes on my own site, great instructions and easy to use. Thanks for the help.

  324. Unfortunately I found that the date-picker is not working in firefox for mac. Anyone know a workaround

    Still trying to solve the custom error page problem. Just dont know where to put the redirecting script

  325. Guys I think I found the solution for the thankyou page!!

    <html>
    <script>
        location = "http://yourdomain/yourthankyou.php";
    </script>
    </html>
    does the trick!!

    Paste it in the dd-formmailer.php in the $sent_message ='';

    Now I need to figure out the damn error page

  326. sorry the first link is: http://www.holandaluz.com/request-quote.php

    Vincent

  327. Hi, great script (best I found actually), Got everything running as I want http://www.holandaluz.com.request-quote.php. They only thing thats utterly, truly, honestly missing is a thank you and error page in my (css) style. Went through the whole 1,831 comments, thought I got with James (1529), but nooo, I get stuck here. Whenever the form is submitted, it´ll go to the standard white page: http://www.holandaluz.com/dd-formmailer/dd-formmailer.php.

    Admin or anyone any suggestion???? Thanks a mil
    Vincent

  328. 1831
    Simon

    We are having some problems getting the form to work when we parse it through to another page. If a field is required it displays

    DDFM_ERRORMSGDDFM_MISSINGVER
    DDFM-REQUIRED_TAG

  329. 1830
    cisono

    I was wondering if this script is really secure? I am using a version from last year and my site has been “hacked”. By this I mean that my *.html files have somehow acquired an <iframe src="… section which downloads trojans and my website has become a google-reported attack site :-(

    I am not blaming your script, but just wanted to check if you would recommend updating to the latest version (and is there an easy way to do this, other than reinstalling and redoing all the customisation).

    Cheers.

  330. how to make the attachment works?

    I currently added the following to $form_struct

    type=file|class=|label=|fieldname=|[req=true]|[allowed=1,2,3]

    but my page at http://hipfiles.com/contact.php is not sending attachment. why?

  331. thanks … i will use this script on my site at http://hipfiles.com – a powerful file search engine soon

  332. 1827
    Rob

    Hi,

    Trying to get this to work. I’ve configured formmailer.php but don’t understand how to reference the file within my contact.html page.

    Thanks,

    Rob.

  333. 1826
    Robert Cook

    After some additional testing, I’ve found that the “Including the Name of the Person Being Sent to When Using selrecip” update chokes on ampersands. Escaping the ampersand didn’t work for me. I’ll freely admit that I have no idea how to fix this, so I’ve solved the problem by removing ampersands from my selrecip options. Perhaps someone better at PHP than me can fix my fix?

  334. 1825
    Robert Cook

    I’ve had some success in figuring out a couple of requests from the comments. (Sorry if your request isn’t covered here; I’m only working on the ones I need myself.) I’m not working with the most current version (using version 5.7 with a boat-load of customization), so I apologize in advance if any of this is fixed/addressed in 5.8.

    These fixes work for me, but don’t come with a guarantee they’ll work for you. :)

    Adding Line Breaks to the Auto-Reply Message:

    Everywhere you want a line break, insert the following:

    ' . PHP_EOL . '

    If you want more line breaks, add PHP_EOL multiple times, with a . in between each one.

    Sending to Additional Recipients When Using selrecip:

    This one was actually sort of answered way back in Comment 1238, but is worth repeating. Find the following line:

    $recipients = $sel_recip;

    Immediately after that line, add this line:

    $recipients .=',name@address.com';

    Replace “name@address.com” with the email address you want it to actually go to. This adds an extra address in the To: field, and doesn’t allow for CC: or BCC: but hey, it’s better than nothing.

    Including the Name of the Person Being Sent to When Using selrecip:

    In the first “case ’selrecip’:” section add the following lines before the “break;”:

    
    $csv .= str_replace($save_delimiter, ' ', $t) . $save_delimiter;
    $mail_message .= $fs['label'] . $msg_field_sep . $t . $msg_field_line_end;
    $message_structure = ddfm_str_replace($fs['fieldname'], $t, $message_structure);
    $auto_reply_message = ddfm_str_replace($fs['fieldname'], $t, $auto_reply_message);
    $sent_message = ddfm_str_replace($fs['fieldname'], ddfm_bsafe($t), $sent_message);
    

    I haven’t been able to figure out how to get the selrecip result to show up in the auto-reply. I’m working on it, but I’m beginning to think it’s beyond my ability. (I’m a PHP hacker, not a PHP programmer. This is the reason my fixes are brute force, far less elegant than the original script.)

    Also, I haven’t been able to figure out how to get the email address from selrecip to show up with or instead of the name, but right now, just the name showing up is better than nothing.

    If I figure either of these out, I’ll post them here.

  335. 1824
    keir

    ” $_POST[fieldname] ”

    Where in the code do you insert this?

  336. If you’re using the manual form code option and want the form to “remember” input data, use this as a field’s value:
    $_POST[fieldname]

    This way, when the form produces an error because a required field has not been filled in, the user does not have to enter everything a second time.

  337. 1822
    Ward B

    How can I add the dropdown ’selrecip’ field to the email message that is sent. The name selected would be best but the email address would be sufficient. I tried to add a fieldname to the first line and then build my own custom message which included all the fieldnames but the result is blank.

    Thanks again for a great script.

  338. First of all, wondeful program. Only one problem, I can type jkewbjcrjk@gugee.com as an email address and it goes through as valid email address. How do you stop invalid emails from passing as valid email?

    Thanks, any help is good.

  339. I have the message “Error Sending Message” Everything seems to be ok. Can I check whether I can use my gmail as recipient or must I need to use email created from Cpanel of my domain name that could cause the error.

    regards

    James

  340. 1819
    claudia

    Hello. : )

    First I want to say thank you for this script. It’s the first one – and I tried a lot – that works for me.

    Anyway, I have two questions:

    1. If I include the script in another php-file, can I put the dd-formmailer-css-codes in the css-file that is already linked in the existing php-file? that there is just one css-file at the end?

    2. The auto-reply-message:
    I want to include the “gender” and the “lastname” (in german “Guten Tag, Frau/Herr Schmidt”).
    Is it possible to put something in this $auto_reply_message = ”; that generates that automatically?

    I would be very greatful if you could help me.

    Best regards.

    Claudia

  341. Hello,

    I made a verry long form, can i divide this in more pages by adding a code?

    Regards

    Harald

  342. After I installed and activated this plugin for wordpress it messed with my whole site and now every link I click on is the first blog posting, even though they url changes.
    Has anyone else had this problem?
    Any advice would be appreciated.

  343. 1816
    Bilgin

    Can the send email button be changed to an image?

  344. 1815
    Tony

    Hey,

    If I have a field in the form that contains a group of check boxes and I want to make sure this field is required for the form to be submitted, how do I do this? I can see you can add the ‘required’ parameter to individual check boxes but what about a group?

    Sorry if this has been asked/answered before… spent a long time scrolling through the comments with no luck ;)

    Hopefully someone has a solution…

  345. 1814
    Fred

    test of your capta

  346. 1813
    xx

    dd

  347. 1812
    Rhys

    Everytime there is a new version of the script I update the one I’m using hoping that it will fix a problem that I’ve had for a long time with the script.
    The script works beautifully in IE7 and firefox. Unfortunately the people in the business that I work tend to use internet explorer 6.
    In older versions of internet explorer 6 [e.g. version 6.0.2900.5512] the script will always fail on the first attempt [even if the right code was entered] but then on the 2nd,3rd,4th attempts it always goes through okay. If I close the browser and then open it up again, it fails on the first attempt but will go through again on the 2nd,3rd,4th attempts.
    For some reason the FIRST TIME the script is run in certain versions of IE6 the COOKIE is not getting rewritten which is causing the following error to appear:
    Notice: Undefined index: ddfmcode in E:domains\g\gplocumcover.co.uk\user\htdocs\comments.php on line 1480
    I really would appreciate a workaround for the script to allow it to work the first time in internet explorer 6.I’ve tried all sorts including writing a P3P policy in case IE6 was being picky about the security settings for the site but it still won’t work.
    Thanks

  348. Hi. Great script but I’m struggling with the form layout. Can anyone point me to the right part of the CSS file that I need to adjust to try an make the form elements line up.

    I would be eternally grateful.

  349. 1810
    Sanjeev

    This is in continuation to my previous comment#1809.
    I tried putting the code at top of the calling script but nothing happened and form kept resubmitting upon refresh.

    I also noticed that in dd_formmailer.php there was no line to check value of $_POST['_REPEATED'] and unless this is checked I believe resubmission upon refresh can not be prevented.

    Please help.

    Thanks.

  350. 1809
    Sanjeev

    I am using standalone = FALSE and after submitting where we see the thank you page, on refresh / reload the form sending result(s) which i want to prevent. Please tell me how to prevent emailing on refresh after first form submission.

    Thanks.

  351. 1808
    Ken Bird

    I cannot process the email form. Get the following message – Warning: preg_match() [function.preg-match]: Compilation failed: unmatched parentheses at offset 354 in /home/ricniven/public_html/kenbirddesigns/contactform/form4/contact.php on line 333
    Error!
    • Invalid input in ‘Name’!
    • Invalid input in ‘Email’!
    • Invalid email address: ‘Email’

  352. oh my god! i see that you’ve put a lot of work in this! nice work!
    i will try this and i will come back with the result!

  353. Impressive work here.

    I have inserted sql statements into the script and it now does all I can ask. But I have to ask if anyone else has looked to the best placement of sql statements to utilize the security of dd-formmailer?

  354. I have no idea what it means or how it got there, but I will try to double check everything. Anybody?

  355. 1804
    Ruby Works

    Great Script! But does anyone know how to align the form center or right? How would I do this?
    Thanks!

  356. 1803
    Christian

    Hi!

    I’m trying to figure out this excellent script – but all new to php…
    My goal is, that I would like the script to send to an outside-domain, but to make this possible I apparantly need to include another recipient from inside the domain:

    $recipients = 'to=username@OUTSIDEdomain.com|to=user@insidedomain.com';

    All this I actually working fine – but I would love to have the resulting message not show the “user@insidedomain.com”, but only the “username@OUTSIDEdomain.com in the “To:”-field.

    How can I work my way around this?

  357. 1802
    Sven

    The arabic signs was replaced, let me try again with code-tags:

    
    ??????
    

  358. 1801
    Sven

    After upgrading to version 5.8 i found this arabic letters in the message area (sent from dd-formmailer):

    ??????

    I have no idea what it means or how it got there, but I will try to double check everything. Anybody?

  359. Nice script. I needed to make the background of the verification image transparent, so I changed this part:

    
    $image = imagecreate(60, 24);
    
    list($br, $bg, $bb) = ddfm_hex_to_rgb($verify_background);
    list($rr, $rg, $rb) = ddfm_hex_to_rgb($verify_text);
    
    $background_color = imagecolorallocate($image, $br, $bg, $bb);
    $text_color = imagecolorallocate($image, $rr, $rg, $rb);
    

    to this:

    
    $image = imagecreatetruecolor(60, 24);
    imagealphablending($image, false);
    imagesavealpha($image, true);
    
    if ($verify_background != 'transparent') {
        list($br, $bg, $bb) = ddfm_hex_to_rgb($verify_background);
    }
    list($rr, $rg, $rb) = ddfm_hex_to_rgb($verify_text);
    
    if ($verify_background == 'transparent')
    {
    	$background_colour = imagecolorallocatealpha($image, 0, 0, 0, 127);
    	imagefill($image, 0, 0, $background_colour);
    }
    else {
        $background_color = imagecolorallocate($image, $br, $bg, $bb);
    }
    $text_color = imagecolorallocate($image, $rr, $rg, $rb);
    

    Now you can set $verify_background to ‘transparent’. Be sure to generate the image as a png.

  360. Awesome, awesome script, thanks a ton for providing your code!

  361. You talked about having an option to “prefill” a text block (my planned use was an online petition). I don’t see that documented… is that available in v.5?

    Also, I see the new script asks for the the URL of the file. I’d be interested in knowing why that field is needed; I have been cutting and pasting your forms between a couple of sites, and it seems to me like a superfluous administrative step.

  362. If I could hug you I would…..thanks for the script worked wonders.

  363. Version 5.8 Released

    Changes:
    - Added Estonian language
    - Added code to check for duplicate field names
    - Usage of commas in checkbox descriptions is now fixed
    - Fixed garbled auto-reply messages
    - Adjusted the displaying of uploaded file names in the email message
    - mb_encode_mimeheader error in WP fixed
    - Other adjustments to email headers
    - Added ‘id’ declaration to select boxes
    - Fixed incorrect example code in the instructions
    - Other minor changes

    The WordPress version of the script is fully compatible with WordPress 2.8

    A few people mentioned problems with the date chooser field type. I tested this out thoroughly, and it seems to be functioning fine. Just be sure (if you are using the PHP version of the script) that you are including the required javascript file.

    As always, I am not able to implement every single requested feature, but I try to focus on known issues, while implementing things that many can benefit from.

    Support for 100% compatibility of non-US character sets is still something that is being looked into. If you have a good deal of experience with writing custom email headers to fully support international character sets and would like to help us out please let me know.

    Enjoy!

  364. Having an issue when using this inside another page. The script works, but when viewing in design view, it distorts my whole page and highlights like theres an error.
    When i add this to page, it distorts my design view in dreamweaver. It works fine on live preview, but I dont want to have to remove this code snippet everytime I need to make an update and paste it back in.

    I believe this is due to the DocType in dd-formmailer at bottom of page for standalone. is there any way to mod that second doctype out or remove it without

  365. Charlie Markwick I have to thank you ’cause you solved my problem (comment 1770)!!!

    thanks a lot and thanks of course for this very useful script.

  366. please can any one help me in this regard, I need php mailer.

    i will be glad if some one can help me for i have try all i can to locate any but not that easy for me. send me the phpmailer to.. donalvinmosley @ yahoo.co.uk
    i wait to hear very any one.

    Don Mosley

  367. 1792
    Crawley

    If I could hug you I would…..thanks for the script worked wonders.

  368. Hello
    I like your script very much

    Thanks

  369. 1790
    Tony

    Brilliant script!

    Just a quick question…

    If I have a field in the form that contains a group of check boxes and I want to make sure this field is required for the form to be submitted, how do I do this? I can see you can add the ‘required’ parameter to individual check boxes but what about a group?

    Sorry if this has been asked/answered before… spent a long time scrolling through the comments with no luck ;)

  370. I had a client that was closed on Mon. and Wed. He wanted the popup calendar that schedules his appointments to reflect this. I had to mess with the code for a while before I got it to work, and thought someone else might need similar functionality. Starting at around line 205 of the date_chooser.js I changed this:

    
    if (dayNum == day)
          html += TD_selected + TD_onclick + DIV_selected + dayNum + xDIV + xTD;
        else
          html += TD + TD_onclick + dayNum + xTD;
    

    to this:

    
    if (dayNum == day)
    html += TD_selected + TD_onclick + DIV_selected + dayNum + xDIV + xTD;
        else if (thisDay.getDay() == 0 || thisDay.getDay() == 3)
          html += TD + DIV_noday + dayNum + xDIV + xTD;
        else
          html += TD + TD_onclick + dayNum + xTD;
    

    and added a var in the table variable section starting at line 152:

    
      var DIV_noday = "<div class='dpNoneAvail'>";
      var xDIV = "</div>";
    

    and in the CSS changed added the class dpNoneAvail and set it to display: none;

    There ya go, works like a charm.

  371. Thanks for the great script. I having an issue when using this inside another page. The script works, but when viewing in design view, it distorts my whole page and highlights like theres an error.
    When i add this to page, it distorts my design view in dreamweaver. It works fine on live preview, but I dont want to have to remove this code snippet everytime I need to make an update and paste it back in.

    I believe this is due to the DocType in dd-formmailer at bottom of page for standalone. is there any way to mod that second doctype out or remove it without breaking up the script?

    having multiple doc types in a page can cause all sorts of validation issues. Thanks for any help.

  372. Hello
    I like your script very much but I have a question.
    After I send the message, I have instructed the script to go to the original script page (using standalone).
    The problem is that if a user presses reload, the message will be sent over and over again, even without any input in the message boxes.
    Any way arround this problem?

    Thank you

  373. 1786
    Bryan

    I’m getting extra text inserted in the auto reply email similar to post #1638 or no text at all, depending on the email client being used.

    In outlook, the message appears normal.

    In gmail, the message appears as follows:

    –d543e43bb2c87a3daf858807ea0d640c
    Content-Type: text/plain; charset=utf-8
    Content-Transfer-Encoding: 8bit

    Thanks for contacting us.

    –d543e43bb2c87a3daf858807ea0d640c–

    In yahoo, I’m not seeing any message at all.

    Default options except for auto reply fields.

  374. 1785
    Tdinh

    CORRECTION

    <p class="fieldwrap"><label><span class="required">*</span> Is this a new job or a reprint:</label><span class="fmradio">
    <input type="radio" name="fm_job" id="New Job" value="New Job" checked="checked" /><label for="New Job" class="fmradiolabel">New Job</label>
    <br /><input type="radio" name="fm_job" id=" Reprint with Changes" value=" Reprint with Changes" /><label for=" Reprint with Changes" class="fmradiolabel"> Reprint with Changes</label>
    <br /><input type="radio" name="fm_job" id=" Reprint without Change" value=" Reprint without Change" /><label for=" Reprint without Change" class="fmradiolabel"> Reprint without Change</label>
    
    <br /></span></p>

  375. 1784
    Tdinh

    I have a problem with my radio buttons. The form works and everything; the emails are sent correctly. The only thing is that, when I try to validate the code with W3, there’s an error with the ID elements. The problem with the ID elements are that there are spaces.

    Here is my line of code for the radio buttons:

    type=radio|class=fmradio|label=Is this a new job or a reprint:|fieldname=fm_job|req=true|default=1|data=New Job, Reprint with Changes, Reprint without change

    The code it generates when uploaded is:

    * Is this a new job or a reprint:
    New Job
    Reprint with Changes
    Reprint without Change

    It is obvious that IDs cannot have spaces in them, so is there any way for me to correct this so that I do not have any validation errors in my code?

    It would be greatly appreciated in finding a solution to this problem.

  376. 1783
    Ward

    I am still trying to get the redirect to work and I am also trying to include the “recipient” selection from the dropdown list in the body of the email such as Recipient: John Smith – once I get these to work, all will be well. Any help would be greatly appreciated and thanks again for a very special script.

  377. I use both the php and wordpress versions of your script on several websites – they’re just fantastic! Keep up the good work!

  378. I’m very impressed with the site. Very clean design. I will continue taking a look at your php form script and see how I can implement it into my site.

    Thanks again!

  379. Outstanding script! I got it to work right out of the box. The only problem I have is that I can not get the page to re-direct after it is submitted. Is there a fix for this? I have tried both suggested ways in the help file and have searched the comments.
    Thanks again!

  380. 1779
    bob smith

    Is this script and earlier version php5 compatible?

  381. 1778
    jaymz9mm

    Very nice and works great – although one strange thing I’ve noticed, if I enter “test@test.com” in the email field of the form, the email consistently doesn’t get sent lol

    No error or anything, and it says the message was sent.

  382. 1777
    Maurits

    Hi Admin, thanks for the great work!!
    The only thing I did not succeed in adapting to my needs is the positioning of the fields.
    I’d like them on the left on the screen instead of centered.
    Where do I have to look?

  383. 1776
    leo

    hey…

    Sorry, I posted already on the wrong page…

    I use the “non-WordPress” Version (5.7) of this Script and I still have Problems with the german special Characters in the “Sent” Mails.

    Does anybody have some ideas for me?

    thanks a lot. leo

  384. 1775
    Gary

    i was looking for a mail-script to replace the flawed “Matt’s Formmail”. This one is quite complex. Can it simply be called from a form I’ve already designed on my site, rather than me using it’s custom architecture to create my form?

    thanks.

  385. 1774
    villas

    I need to know how to put another field : “email confirmation” that is to prevent email digitation error (and verify if 2 fields “email” are equal. Sory my bad english. Thanks

  386. Great script and it just keeps getting better over the years. I would suggest for future releases a couple things.

    1) Making uploaded file names unique by appending date()
    2) Including any uploaded file names in the notification mail

    ~ carry on ~

  387. 1772
    mcChris28

    oh snap!…it was because i tried to implement my own submit button image and value, removing DDFM_SUBMITBUTTON… :(

    anybody done this before?…i can’t find this variable lurking anywhere but in the form output area…how/where is the ’send email’ value generated?…

  388. 1771
    mcChris28

    i’m using this script for the first time, as an include, and i’m having an issue with the form submitting the email…

    in ff and chrome my form submits just fine and email is received…

    in ie6 and opera, on submit, there is no $sent_message generated…the page refreshes with a new verification image…no email is sent…

    i’ve yet to test ie7-8 and safari…

    and i don’t see any other comments regarding this issue…perhaps i’ve done something wrong…any thoughts or suggestions?

  389. great script. However as it stands (Version 5.7) the script generated an error for me:

    Use of undefined constant mb_encode_mimeheader - assumed 'mb_encode_mimeheader'

    It is resolved by changing line 595 from:-

    if (function_exists(mb_encode_mimeheader)) {

    to:-

    if (function_exists('mb_encode_mimeheader')) {

  390. Excellent script!

    I am having a curious problem though that I can’t solve. A typical contact form (email, name, message) plus one file-upload input field. Everything works fine on all browsers on both the PC and Mac (IE 6/7/8, Firefox, Opera, Chrome)… all except for Safari 4 Beta and Safari 3 on the Mac. When submitting the form with a file attached, Safari just hangs… until I hit the submit a second time, then it works fine. It is not even that consistent. 20% of the time or so, it does work on the first submit, but the rest of the time requires two submits.

    I’ve been searching the web but can’t figure out if it has anything to do with your script, or, morel likely a Safari, Javascript, jQuery oddity.

    Any thoughts will be much appreciated.

  391. Hi,
    Great script! Worked out of the box with no issues and I’m just a PHP code nugget! Thanks again!
    Cheers,
    James

  392. 1767
    Rob Cook

    Has anybody come up with a way to include the results of a type=selrecip in the body of the email message? I’ve seen the question asked several times, but haven’t seen any answers.

  393. 1766
    dell

    can this script be called from an html file? Im wanting to have the mail form on numerous pages but dont want to have to rename a bunch of them to .php files.

    I hope this can be done as I really like the layout and look of this script, and its ease and functionality.

    Thanks.

  394. 1765
    MowC

    Is there a way to style the button, replacing it with an image?

  395. As Jacob, I also cannot get the asterisk to display for the required fields. They are req, and the form works fine, if req fields aren’t filled in the error message displays. I know the lang file is being read as the submit button, and error messages report correctly. It’s just the asterisk that don’t display.

    I have check my CSS files, the dd-formmailer.css and all other settings and everything checks out. The other forms on my other sites work fine and show the asterisk, and I can’t figure this out.

    Note, of the 4 other forms I use, this is the only one that is the latest version… dunno if that helps.

  396. Hi, is it possible to send the fields from the form as an email attachement?
    Thanks a lot,
    Miro

  397. What is the license of this script?
    Perhaps indicate on the page and script itself.

  398. 1761
    Jo

    How do you format the auto reply?
    –start code–

    $auto_reply_name = ‘Made up Company’;
    $auto_reply_email = ‘info@madeupcompany.org.uk’;
    $auto_reply_subject = ‘Auto Reply’;
    $auto_reply_message = ‘Thank you for contacting Made Up Company, we will endeavour to get back to you at the earliest convenience. Here is a copy of the message you sent for your records. fm_message Many thanks’;

    –endcode–

    As you can see I’ve included the senders message into the auto reply. But I would like to be able to add new lines and rulers.

    –startexample–

    Thank you for contacting Made Up Company, we will endeavour to get back to you at the earliest convenience.
    NEW LINE HERE
    Here is a copy of the message you sent for your records.
    RULER LINE HERE
    fm_message
    RULER LINE HERE
    Many thanks

    –endexample–

    Hope someone can help, cheers.

  399. 1760
    bcoadmin

    Oops, sorry about my last post – the code was not wrapped correctly!

    @Jacob,

    The problem is possibly due to your hosting server or ftp program forcing lowercase filenames.

    In dd-formmailer.php change the following: -

    $language = ‘lang/English.php’;

    to

    $language = ‘lang/english.php’;

    Hope this helps…

  400. 1759
    bcoadmin

    @Jacob,

    The problem is possibly due to your hosting server or ftp program forcing lowercase filenames.

    In dd-formmailer.php change the following: -

    $language = ‘lang/English.php’;

    to

    $language = ‘lang/english.php’;

    Hope this helps…

  401. 1758
    franky

    Ben is right, a forum would be great.

  402. 1757
    Dario

    Can I customize the errors page? I use the code integrated on my website design but when the client misses the code or any require data, the form shows without css format and on a new page, what can I do to preserve my design on missing info errors?

    Thanks.

  403. I suggest we start a forum for this script, there are some good messages here (and replies) but I have trouble locating them easily in this format.

  404. I see several comments asking about the error “No Verification Code Generated” this will appear in browsers with session cookies disabled when verification is set to “basic”

    You can change your verification method to ReCaptcha or change the error message to explain what is happening.

    In lang/English.php I have redefined ‘DDFM_NOVERGEN’ to read
    define('DDFM_NOVERGEN', '<br /><a target="_blank" href="http://www.tubal-reversal.net/cookies.htm"><img src="http://www.tubal-reversal.net/images/icons/enable-cookies.gif" alt="Please allow cookies to use this form." width="222" height="26" border="0" /></a><br />');

    eg. tubal-reversal.net/feedback/index.php