Yesterday, I spent some time figuring out how to add my own PHP code to make an email contact form work properly. Unfortunately, PHP’s mail() function didn’t work for Bluehost servers hosting the contact form on my site. There seems to be some special code required for Bluehost. Here’s what worked for me:

  1. Set up your typical contact form within <form> tags.

  2. Set you <form>’s action to point to Bluehost’s BlueMail and make the opening tag look like the following:

<form action="http://www.bluehost.com/bluemail" enctype="multipart/form-data" method="POST">
3. Set the email address that you want to send to:
<input type="hidden" name="sendtoemail" value="shout@bluehost.net">
NOTE: Using this method, you can only send email to a Bluehost email address Ex: dan@simplyadvanced.net would work because it is hosted by Bluehost servers. Using a Gmail address did not work.
4. (Optional) Change the redirect after user clicks the submit button:
<input type="hidden" name="redirect" value="http://example.com/">
Here’s a very simple example for working code, no PHP file required with this Bluehost method:
<form action="http://www.bluehost.com/bluemail" enctype="multipart/form-data" method="POST">
    <input type="text" name="name" id="name" placeholder="Name" />
    <input type="text" name="email" id="email" placeholder="Email" required />
    <textarea name="message" id="message" placeholder="Message" required></textarea>


    <input type='hidden' name='cgiemail-mailopt' value='sync' />
    <input type="hidden" name="sendtoemail" value="dan@simplyadvanced.net" />
    <input type="hidden" name="subject" value="DanialGoodwin.com - Contact Form" />
    <input type="hidden" name="redirect" value="http://danialgoodwin.com/messagethankyou.html" />
    <input type="submit" value="Send Message" class="button form-button-submit" />
</form>
All information in within the form tags will be send to the designated email address. You can find more information and keywords at the source mentioned below.

Source: In your Bluehost’s cPanel, navigate to “CGI Center” and choose BlueMail so that you can see more information regarding this issue. If you are logged in, then you might be able to use <link>.

 - Danial Goodwin -
Co-Founder and Lead Developer for Simply Advanced, LLC