Contact form doesn't work on new hosting

the mail() function

Moderators: macek, egami, gesf

pghdesigner
New php-forum User
New php-forum User
Posts: 4
Joined: Fri Feb 10, 2012 8:51 pm

Contact form doesn't work on new hosting

Postby pghdesigner » Fri Apr 05, 2013 5:49 pm

I'm having issues with this contact form. I've used it several times with no problems on different hosting. Now when I put it on Godaddy it doesn't work. I even uploaded it to my own personal hosting and it works perfect.. Just not on godaddy. I'm not sure if there's a problem with the code or what. I'm lost of what it could be. Does anyone know what I should look for? I'm frustrated over here..

Just so you guys know I'm not too good with PHP.. But..

Here's the code. It's simple..

Code: Select all

 <?php
if(isset($_POST['submit'])) {

$to = "lillizzierae@aol.com";
$subject = "Disney Contact Form";
$name_field = $_POST['name'];
$phone_field = $_POST['phone'];
$email_field = $_POST['email'];
$message = $_POST['message'];

$body = "From: $name_field\n E-Mail: $email_field\n Phone: $phone_field\n Message:\n $message";

echo "";
mail($to, $subject, $body);

} else {

echo "Go back";

}
?>




The actual form.

Code: Select all

<form action="contactthanks.php" method="post">
<table width="450" border="0" cellspacing="10">

                     <td width="440" align="left"><label for="name">*Name:</label><br /><input type="text" name="name" id="name" /></td>
                       </tr>
                       <tr>
                      <td align="left"><label for="city">Phone:</label>
                        <br /><input type="text" name="city" id="city" /></td>
                       </tr>
                       <tr>
                      <td align="left"><label for="email">*Email:</label><br /><input type="text" name="email" id="email" /></td>
                       </tr>
                       <tr>
                      <td align="left"><label for="message">*Message:</label><br /><textarea name="message" rows="10" cols="40" id="message"></textarea></td>
                       </tr>
                            <td align="left"><label for="answer">*Type in the following answer to the question:<br />2 + 2 =</label><br /><input type="text" name="answer" id="answer" /></td>
                       <tr>
                      <td align="left"><input name="submit" type="submit" class="submit-button" onclick="MM_validateForm('name','','R','email','','RisEmail','answer','','RinRange4:4','message','','R');return document.MM_returnValue" value="Submit" /></td>
                       </tr>
                  </table>
                  </form>

seandisanti
php-forum Fan User
php-forum Fan User
Posts: 838
Joined: Mon Oct 01, 2012 12:32 pm

Re: Contact form doesn't work on new hosting

Postby seandisanti » Tue Apr 09, 2013 11:01 pm

A while back i ran into some headaches trying to mail from godaddy, and added that to the laundry list of reasons to send my customers elsewhere. Sorry, I know that's not productive, but I have several horror stories about their service or lack thereof. I seem to remember there being an issue because of their stupid 'relay-secureserver.net' or something... searching for 'php mail godaddy' and any negative adjective will get you many results. here's one http://kennethsutherland.com/2012/07/27 ... r-godaddy/

KenGoDaddy
New php-forum User
New php-forum User
Posts: 4
Joined: Wed Dec 05, 2012 11:39 pm

Re: Contact form doesn't work on new hosting

Postby KenGoDaddy » Wed Apr 17, 2013 3:35 am

@pghdesigner,

I'm with Go Daddy and came across your post.

Have you been able to get your contact form working on your hosting account since your post?

If not or if you have any additional questions, please feel free to reply or send me a private message.

seandisanti
php-forum Fan User
php-forum Fan User
Posts: 838
Joined: Mon Oct 01, 2012 12:32 pm

Re: Contact form doesn't work on new hosting

Postby seandisanti » Wed Apr 17, 2013 1:53 pm

Also look into phpMailer. I've had good luck with it even with some pretty bad hosts.


Return to “PHP coding => Mail”

Who is online

Users browsing this forum: No registered users and 0 guests