SitePoint Sponsor

User Tag List

Results 1 to 12 of 12

Threaded View

  1. #1
    SitePoint Member
    Join Date
    Mar 2013
    Location
    Ottawa, Ontario
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Problem woth Godday hosted site and forms

    Hi there,

    I'm pulling my hair out to figure out this problem I'm having with a form: it accepts the form once I click "submit" (I get the message "Thank you for the message. We will contact you shortly.", which is in my php file), but no emails are received on my end. I try different e-mails, and nothing. Godaddy says they want me to use their special php file and enter the recipient email via a web page (log in, navigate to page and enter the email address) which is something I don't want to do: I want to just modify the php file I created and not their interface (which is a royal pain).
    Here is my HTML code in a file called contact_us_test.html:

    HTML Code:
    <form action="contact.php" method="get" name="contact">
              <table width="100%" border="0" cellpadding="5">
                <tr>
                  <td colspan="2">&nbsp;</td>
                  </tr>
                <tr>
                  <td colspan="2">&nbsp;</td>
                  </tr>
                <tr>
                  <td align="right"><label for="name">Full Name/label></td>
                  <td><input type="text" name="name" id="name" /></td>
                </tr>
                <tr>
                  <td align="right"><label for="email">Email Address/label></td>
                  <td><input type="text" name="email" id="email" /></td>
                </tr>
                <tr>
                  <td align="right"><label for="phone">Phone number with area code/label></td>
                  <td><input type="text" name="phone" id="phone" /></td>
                </tr>
                <tr>
                  <td height="138" colspan="2" align="right" valign="top"><label for="message">How may we help you?</label>
                    <textarea name="message" id="message" cols="60" rows="10
                    "></textarea></td>
                  </tr>
    
                <tr>
                  <td colspan="2" align="center"><label for="submit"></label>
                    <input type="submit" name="submit" id="submit" value="Submit" /></td>
                  </tr>
                <tr>
                  <td align="right">&nbsp;</td>
                  <td>&nbsp;</td>
                </tr>
                <tr>
                  <td>&nbsp;</td>
                  <td>&nbsp;</td>
                </tr>
              </table>
            </form>
    and here is the php file called contact.php

    PHP Code:
    <?php
    $field_name 
    $_POST['name'];
    $field_phone $_POST['phone'];
    $field_email $_POST['email'];
    $field_message $_POST['message'];


    $mail_to 'sales@fixit2sellit.com';
    $subject 'Message from a site visitor '.$field_name;

    $body_message 'From: '.$field_name."\n";
    $body_message .= 'E-mail: '.$field_email."\n";
    $body_message .= 'Message: '.$field_message;

    $headers 'From: '."myname@mydomain.com"; <---- NOTE:  I've inputted the correct email here (checked with 3 different ones) , and it's not on their list of prohibited domains.
    $headers .= 'Reply-To: '.$field_email."\r\n";

    $mail_status mail($mail_to$subject$body_message$headers);

    if (
    $mail_status) { ?>
        <script language="javascript" type="text/javascript">
            alert('Thank you for the message. We will contact you shortly.');
            window.location = 'contact_us_test.html';
        </script>
    <?php
    }
    else { 
    ?>
        <script language="javascript" type="text/javascript">
            alert('Message failed. Please, send an email to lblanchet@fixit2sellit.com');
            window.location = 'contact_us_test.html';
        </script>
    <?php
    }
    ?>
    Anything jump out at you as en error?
    Last edited by Force Flow; Mar 13, 2013 at 19:32. Reason: added code tags


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •