Web Hosting Knowledge Base
How to get an existing contact form to work?4 min read
If you have a PHP contact form that is unable to send messages, try the solution provided below.
Open your contact form’s PHP file in a text editor and insert the following code into it:
Save the changes you have just made, and then run your script in a browser to test its sending capabilities.
Note: Make sure you replace
firstname.lastname@example.org with a valid e-mail address created through our system. If you have not yet had a chance to set up an e-mail address on your AwardSpace mail server, please review our How to create an email account? article for more information on how to craete an e-mail ID.
The above code basically sets the e-mail address entered in the contact form to be set as “Reply-To” header and you set your e-mail address created through our system as a sender (“From” header).
It is important to note that these changes need to be added to the
$headers variable, so it is vital that you add them to the PHP mail() function.
If your PHP script already contains the
$headers variables, you will have to add the same code but with a small tweak:
Basically, you will need to put a dot (.) between the $headers variable and the equal sign.
Again, make sure you replace
email@example.com with a valid AwardSpace e-mail account.
It's Time to Share Your Story.
Get Free Web Hosting. Start a website, and introduce yourself to the world.