Form To Email Simple, Cloud Based Form Processing

Developer Support »

Not receiving email

First check that the script is uploaded to your webspace. If you are getting the "thank you" page when the form is sent, then you have uploaded the script correctly. See the "Installing the script" page on the support section for more information.

Check that you have entered your (valid) email address correctly on the script. See the "Installing the script" section on the support page for more information. For test purposes, try using a Hotmail email address. They work fine with the script (as do most but might be marked as junk initially). If you are using an AOL email address, see below about the fifth parameter.

You must have PHP on your webserver (version 4.1.0 or later). The PHP mail() function must be working correctly. Safe mode must be off. These are factors under the control of the webhost/server admin and are outwith the scope of this script or support but do see the information below where you can make some changes. It would be best to seek confirmation of the above from your webhost.

Check that there are no errors on your form page. Run it through the W3C markup validator. If you have errors, fix them all or try making a form page containing the basic form code ONLY, that is supplied with the script.

Check that there are no email filters at your end rejecting the email from the script. Check for filters on the subject line. I have known cases where an email is rejected if the subject line contains ".com". Check that the email is not in the junk or spam folders.

Some servers, particularly Windows, use SMTP to send email and do NOT use the PHP mail() function. You must check with your host and be sure that the PHP mail() function is enabled and working. This is a requirement for the script to work.

If your site is on a Windows machine using the PHP mail() function, then you might get errors like these:

Warning: mail() [function.mail]: SMTP server response: 554 ... Recipient address rejected: Relay access denied in ...
Warning: mail(): SMTP server response: 550 5.7.1 Unable to relay for ...
Invalid From: header

These errors are usually caused by not having the PHP configuration file (php.ini) configured correctly on your system (your host can advise further). You can try the solution below to correct this. You need to add some code to the script, save it and upload it to your webspace.

Locate this line in the script (near the bottom):

mail($my_email,$subject,$message,$headers);

Above it add this line:

ini_set("sendmail_from","user@example.com");

So it now looks like this:

ini_set("sendmail_from","user@example.com");
mail($my_email,$subject,$message,$headers);

Replace "user@example.com" with your username and domain (in other words, a valid email address for your server). Save the script and upload it.

Some hosts require a fifth (-f) parameter to be used with the mail() function. If in doubt, ask your host about it. This is to allow the email to be filtered by the mail server. It also allows you to set a return path. AOL for example will reject emails from the script unless you set this (Hotmail and Googlemail do not require it). This parameter would normally contain your username and domain name, like so:

mail($my_email,$subject,$message,$headers,"-fuser@example.com");

Note the "-f" at the start of the email address. This must be present. Note also that the line above might work as it is if simply setting a return path. Try it first if you're not sure.

Some hosts require that the From: address is an address on your server, and not the address of your site visitor, as is default. If you need to set this, you can hard-code a From: address into the script. You need version 2.5 or later of the free script or version 3.4 or later of the Pro script for this facility. When hard-coding a From: address into the script, you can still reply to the visitor's email by hitting "Reply" as the Reply-To: header is used in this case.