cancel
Showing results for 
Search instead for 
Did you mean: 
Go to solution
New

Contact Form Script

Hi Guys,

Anyone able to let me have a contact form script which is guaranteed to work on GoDaddy?

I've got Formmail and configured it precisely as advised in the user guide.

The formmail test script generates a 'form working' reponse but when the form itself is tested no emails reach my inbox.

Chatline suggestions, such as they were, failed to work.

Surely contact forms can be made to function correctly on the GoDaddy platform? Or not?

It shouldn't be this uncertain, especially with an outfit like GoDaddy.

 

14 REPLIES 14
Super User I Super User I
Super User I

Re: Contact Form Script

There are few guarantees in life and sadly contact forms and coding aren't the exception @Walt1. There are several reasons why emails wouldn't be getting to you and it sounds like you need to troubleshoot? It could be anything from your form to your mailbox. Perhaps a form solution that keeps responses in a database rather than relying strictly on email? 

 

...turns out that my two cents is worth less or more depending on the current exchange rate.

roy darling *my posts seem a lot shorter in my head

New

Re: Contact Form Script

Thanks for your input @rd.

Troubleshoot?

That's been ongoing for a little while to no avail. The script has a detailed user guide with progressive stages of advice on how to overcome the issue, and none has so far been effective. The final piece of advice is: "...contact your host and ask for a script which works on their system."

The 'testmail' script that comes with the form script generates a positive response which means the form is correctly scripted and ready to handle visitor inquiries but test messages using the form never make it to my inbox.

I note there are lots of complaints online by those whose forms either don't work at all on GoDaddy hosted sites or suddenly stop working without explanation, so maybe - just maybe - the issue could actually be GoDaddy based?

Anyway, I'll try another script and if that also fails maybe a change of hosting service would be the way to go.

Super User I Super User I
Super User I

Re: Contact Form Script

I'd have to look at the code to give any insight on what was going wrong with your configuration @Walt1. How the email is configured to send (secure/unsecured) could impact the process. I typically start with troubleshooting because it does you what to investigate more. If you can't say what is going wrong then you'll probably have no one claiming responsibly. That sounds like where you are now? 

 

The test script running on the server side is only half of the equation. One reason I suggested using a database for responses is so that you could eliminate potential errors that might cause your issue. There are solutions that both email and keep database entries for submissions, perhaps fry one of those? Have you even tried to use your own contact form? 

 

...turns out that my two cents is worth less or more depending on the current exchange rate.

roy darling *my posts seem a lot shorter in my head

Community Manager
Community Manager

Re: Contact Form Script

Hey @Walt1. I'm not sure it will help in your situation, but there is a post here that discusses things you can try/check to deal with common outbound email issues. Hope it helps. 

 

JesseW - GoDaddy | Community Manager | 24/7 support available at x.co/247support | Remember to choose a solution and give kudos.
New

Re: Contact Form Script

@rdYesterday I decided to try the webformmailer.php script provided by GoDaddy as part of their hosting service, and which resides in my root directory - logic being this is an in-house approved script and therefore would automatically be acceptable to the GoDaddy system. I made no alteration to the script code. Result? No change - emails still not getting through to my GoDaddy email inbox despite my making the recommended adjustments to my DNS profile and my form configuration that @JesseW kindly directed me to and which have evidently proved successful for someone else.

I note that DNS adjustments can take up to 48 hours to become effective, so we'll see how things pan out when that deadline is reached. Thanks for all your help so far.

New

Re: Contact Form Script

Thanks @JesseW.

I've tried the suggested solutions you directed me to but emails still not getting through to my GoDaddy email inbox.

New

Re: Contact Form Script

Omitted to mention in my earlier reply to you today, @rd. that I certainly have used my own form - many times, in fact. That's how I know my messages aren't getting through to my inbox. Thanks again.

 

Super User I Super User I
Super User I

Re: Contact Form Script

@Walt1 wrote:

Thanks JesseW.

I've tried the suggested solutions you directed me to but emails still not getting through to my GoDaddy email inbox.

 
Walt1 wrote:

Omitted to mention in my earlier reply to you today, @rd. that I certainly have used my own form - many times, in fact. That's how I know my messages aren't getting through to my inbox. Thanks again.

The issue you have listed is why I first suggested that you start with troubleshooting @Walt1. What my original thought was this might have something to do with secure sending of emails? I don't know if your form is sending securely and your email is not accepting them or if your form is sending unsecured emails and your email is rejecting them. Note that security settings for  domains and email systems have changed and not every form script changed with them. I don't claim to know your specific situation but those are common issues I run into. I'd like to understand where this is broken but you don't seem to know and I unfortunately can't offer more unless there is a clearer understanding of the issue?

 

What I can tell you is that I have forms on websites with GoDaddy domains, hosted on GoDaddy servers, with GoDaddy IPs, going to several email accounts on GoDaddy, Gmail and various other email vendors and I do not have a issue  with receiving form notifications on my setups.

 

...turns out that my two cents is worth less or more depending on the current exchange rate.

roy darling *my posts seem a lot shorter in my head

New

Re: Contact Form Script


@rd wrote:
@Walt1 wrote:

Thanks JesseW.

I've tried the suggested solutions you directed me to but emails still not getting through to my GoDaddy email inbox.

 
Walt1 wrote:

Omitted to mention in my earlier reply to you today, @rd. that I certainly have used my own form - many times, in fact. That's how I know my messages aren't getting through to my inbox. Thanks again.

The issue you have listed is why I first suggested that you start with troubleshooting @Walt1. What my original thought was this might have something to do with secure sending of emails? I don't know if your form is sending securely and your email is not accepting them or if your form is sending unsecured emails and your email is rejecting them. Note that security settings for  domains and email systems have changed and not every form script changed with them. I don't claim to know your specific situation but those are common issues I run into. I'd like to understand where this is broken but you don't seem to know and I unfortunately can't offer more unless there is a clearer understanding of the issue?

 

What I can tell you is that I have forms on websites with GoDaddy domains, hosted on GoDaddy servers, with GoDaddy IPs, going to several email accounts on GoDaddy, Gmail and various other email vendors and I do not have a issue  with receiving form notifications on my setups.

 


All right @rd I accept your points.

Take a look at the following and let me know what you think:

 

  • The contact form concerned can be viewed at www.okeham.com/photography/contact.html
  • Take a look at the page source code and you'll find the form configuration details logged around rows 89 to 111.
  • You'll notice that the form script is webformmailer.php which was provided by GoDaddy as part of their hosting service. I've used the script as is: no edits or adjustments made.
  • You'll also see that the form is encrypted: enctype="multipart/form-data"

It's nice to note that it's possible to get forms to work on GoDaddy hosted sites - I was seriously beginning to doubt it!

Anyway, @rd, I'm grateful for your patience in the face of my unconcealed irritation.

Super User I Super User I
Super User I

Re: Contact Form Script

Full disclosure @Walt1, I don't generally use either the webformmailer.php or gdform.php for various reasons. I'm wondering if you've followed the instructions for Specifying an Email Address for the PHP Form-Mailer in the Using Our PHP Form Mailers on Web & Classic Hosting? I don't know what your files look like but you might also want to try How Do I Reinstall the Default Scripts Directory? so that you can start fresh. I see your form code on your form but I don't see the webformmailer.php I can't see.

 

...turns out that my two cents is worth less or more depending on the current exchange rate.

roy darling *my posts seem a lot shorter in my head

New

Re: Contact Form Script


@rd wrote:

Full disclosure @Walt1, I don't generally use either the webformmailer.php or gdform.php for various reasons. I'm wondering if you've followed the instructions for Specifying an Email Address for the PHP Form-Mailer in the Using Our PHP Form Mailers on Web & Classic Hosting? I don't know what your files look like but you might also want to try How Do I Reinstall the Default Scripts Directory? so that you can start fresh. I see your form code on your form but I don't see the webformmailer.php I can't see.

 


Thanks @rd.

Yes, I specified my GoDaddy email address in Form Mail pretty much at the outset. And around the same time I also read and implemented guidelines in the 'Using Our PHP Form Mailers...' article - both to no avail.

About three-quarters of an hour ago, following your suggestion, I reinstalled the default scripts directory. Early results have proved negative.

Can't see any means of attaching a document to this post so have uploaded the updated Formmailer.php script to a temporary directory at my Okeham domain. You can download it at:

http://www.okeham.com/webformmailerscript/webformmailerscript.zip

So, as things stand, you now have all the information I have at my disposal.

If you draw a blank with all of this could you let me have the form scripts you personally use and find successful, together with your recommended form fields' configuration details?

Super User I Super User I
Super User I

Re: Contact Form Script

You can use the code snippet </> from the toolbar and paste the content from the webformmailer.php inside @Walt1.

<center><form method="post" action="webformmailer.php">
       Name: <input name="name" type="text"><br />
       Email: <input name="email" type="text"><br>
       Message:<br>
<textarea name="message" rows="15" cols="40"></textarea><br>
<input type="submit">
</form></center>

I couldn't recommend a solution without knowing what you are using as your solution. It looks like you are using WebPlus but that can't be right can it? 

 

...turns out that my two cents is worth less or more depending on the current exchange rate.

roy darling *my posts seem a lot shorter in my head

New

Re: Contact Form Script

WebPlus is a HTML editor and has no involvement in .php scripting, @rd

Here's the most recent GoDaddy edition of the Webformmailer script:

<?php

if ( !isset($_SERVER['SPI'])) {
        die();
}

if (!isset($_SERVER['DOCUMENT_ROOT'])) {
        echo("CRITICAL: we seem to be running outside of the norm.\n");
        header("Location: http://".$_SERVER["HTTP_HOST"]."/");
        die("CRITICAL: Document root unavailable.\n");
}

$request_method = $_SERVER["REQUEST_METHOD"];
if($request_method == "GET") {
        $query_vars = $_GET;
}
elseif ($request_method == "POST") {
        $query_vars = $_POST;
}

reset($query_vars);
function customsort($a,$b) {
        // $a is array for form vars, $b is comma seperated case sensitive field order
        // this is case sensitive -- good idea to hrc that.
        $data = array();
        if ( strstr($b,',') == FALSE )  {
                $b = $b.",";
        }
        $ordering = split(',',$b);
        foreach ($ordering as $orderitem) {
                if ( ($orderitem != null) && ($orderitem != "") ) {
                        if (isset($a[$orderitem])) {
                                $data[$orderitem] = $a[$orderitem];
                        }
                }
        }
        foreach ($a as $key=>$val) {
                $data[$key] = $a[$key];
        }
        return $data;
}

function xmlentities($string) {
        return str_replace ( array('&', '"', "'", '<', '>'), array('&amp;', '&quot;', '&apos;', '&lt;', '&gt;'), $string);
}

$t = date("U");

$formhomedir = preg_replace('/.*\/home\/content/','',$_SERVER['DOCUMENT_ROOT']);
$formhomedir = explode('/',$formhomedir);
if (count($formhomedir) <= 4) {
        $formhome="/home/content/".$formhomedir[1]."/".$formhomedir[2]."/data/";
}
else {
        $formhome="/home/content/".$formhomedir[1]."/".$formhomedir[2]."/".$formhomedir[3]."/".$formhomedir[4]."/data/";
}

$file_order = ".default";
$file_format = ".text";
$file_interval = ".15m";
$field_order = "";

if (isset($query_vars['form_order'])) {
        if ($query_vars['form_order'] != "alpha") {
                $field_order=$query_vars['form_order'];
                $file_order=".custom";
                $query_vars = customsort($query_vars,$field_order);
        }
        else {
                switch ($query_vars['form_order']) {
                        case "alpha":
                                uksort($query_vars,'strnatcasecmp');
                                $file_order=".alpha";
                        break;
                        default:
                                $file_order=".default";
                        break;
                }
        }
}

if (isset($query_vars['form_format'])) {
        switch ($query_vars['form_format']) {
                case "csv":
                        $file_format = ".csv";
                break;
                case "html":
                        $file_format = ".html";
                break;
                case "xml":
                        $file_format = ".xml";
                break;
                case "text":
                case "default":
                default:
                        $file_format = ".text";
                break;
        }
}

if (isset($query_vars['form_delivery'])) {
        switch ($query_vars['form_delivery']) {
                case "hourly":
                        $file_interval = ".60m";
                break;
                case "hourly_digest":
                        $file_interval = ".60mc";
                break;
                case "daily":
                        $file_interval = ".24h";
                break;
                case "daily_digest":
                        $file_interval = ".24hc";
                break;
                case "digest":
                        $file_interval = ".15mc";
                break;
                case "default":
                default:
                        $file_interval = ".15m";
                break;
        }
}

$file = $formhome."form_".$t.$file_order.$file_format.$file_interval;
$fp = fopen($file,"w");

reset($query_vars);
switch ($file_format) {
        case ".csv":
                $csvkeys = "";
                $csvvals= "";
                $firsttime = "";
                while (list ($key, $val) = each ($query_vars)) {
                        if ( ($key == "form_order") ||
                                ($key == "form_format") ||
                                ($key == "form_delivery") ||
                                ($key == "redirect") ) {
                        }
                        else {
                                if ($csvkeys != "") {
                                        $firsttime=",";
                                }
                                $tmpkey=escapeshellcmd($key);
                                $csvkeys = $csvkeys.$firsttime."'".$tmpkey."'";
                                $tmpval=escapeshellcmd($val);
                                $csvvals = $csvvals.$firsttime."'".$tmpval."'";
                        }
                }
                fputs($fp,"$csvkeys\n");
                fputs($fp,"$csvvals\n");
        break;
        case ".html":
                fputs($fp,"<table border=\"1\" cellspacing=\"1\" cellpadding=\"2\">\n");
        break;
        case ".xml":
                fputs($fp,"<form>\n");
        break;
}

reset($query_vars);
while (list ($key, $val) = each ($query_vars)) {
        if ($key == "redirect") {
                $landing_page = $val;
        }
        if ( ($key == "form_order") ||
                ($key == "form_format") ||
                ($key == "form_delivery") ||
                ($key == "redirect") ) {

        }
        else {
                switch ($file_format) {
                        case ".html":
                                fputs($fp,"\t<tr>\n");
                                fputs($fp,"\t\t<td><b>$key</b></td>\n");
                                fputs($fp,"\t\t<td>$val</td>\n");
                                fputs($fp,"\t</tr>\n");

                        break;
                        case ".csv":
                                // content is already output
                        break;
                        case ".xml":
                                fputs($fp,"\t<field>\n");
                                fputs($fp,"\t\t<fieldname>".xmlentities($key)."</fieldname>\n");
                                fputs($fp,"\t\t<fieldvalue>".xmlentities($val)."</fieldvalue>\n");
                                fputs($fp,"\t</field>\n");
                        break;
                        case ".text":
                        default:
                                fputs($fp,$key.": ".$val."\n");
                        break;
                }
        }
}

switch ($file_format) {
        case ".html":
                fputs($fp,"</table>\n");
        break;
        case ".xml":
                fputs($fp,"</form>\n");
        break;
}


fclose($fp);

if ($landing_page != "") {
        header("Location: http://".$_SERVER["HTTP_HOST"]."/$landing_page");
}
else {
        header("Location: http://".$_SERVER["HTTP_HOST"]."/");
}


?>
Highlighted
New
Solution

Re: Contact Form Script

The problem has been resolved, @rd.

It appears GoDaddy's server, seemingly as a protection against spam, refused to use the unknown incoming email addresses of visitors' using the form to re-direct those messages to my inbox. But after I entered a new hidden field in my form: Name: mail_options Value: FromAddr=myemail@mysite.com, messages now come through correctly.

Of course, I have to allow that changes I made earlier to my hosting configuration which alone didn't improve matters may nonetheless have made a positive contribution once 'FromAddr=' was added to my form hidden fields. On the other hand, the use of 'FromAddr=' might have done the trick on its own and anyone else experiencing a similar issue would be wise to try it anyway - always, of course, replacing 'myemail@mysite.com with their own (preferably GoDaddy) email address.

In any event, panic over and loud cheers all around!

Thank you for your kind involvement, @rd.