Jump to content

[SOLVED] Email Form - Recieving not recieveing on different servers...


LostKID

Recommended Posts

Hi there everyone im stuck in quite a pickle i recently posted a topic saying i was having trouble sending emails to our clients via an online form. My problem was answered and it fixed the problem ( atleast on our server where we hosted the file ) we put the email address as our location ( the studio ) for testing purposes. tested and it works, we recieve the email no problems no errors. Yet when we upload to our clients server and change the email ( to the correct one, its been checked ) they say they dont recieve the email. This is the same .php script they previously used we simple took it and used the variables for the form.

 

anyway do you think there is a problem with the script itself or something else??

 

 

<form method="POST" action="contact.php"><div align="center">  <table border="0" align="left" cellpadding="0" cellspacing="3">      <tr>        <td colspan="2" align="left" valign="middle"><span class="style3">Instant Email!</span><br />          Please fill out all the fields marked: (<span class="style2"> *</span> )</td>        </tr>      <tr>        <td align="left" valign="middle"> </td>        <td align="left"> </td>      </tr>      <tr>        <td width="98" align="left" valign="middle">Company:</td>        <td width="573" align="left"><font face="Arial" size="3">          <input name="Company" type="text" size="42" />        </font></td>      </tr>      <tr>        <td colspan="2" align="left" valign="middle"><img src="seperator.jpg" width="200" height="10" /></td>        </tr>      <tr>        <td width="98" align="left" valign="middle">First Name: (<span class="style2"> *</span> )</td>        <td width="573" align="left"><font face="Arial" size="3">          <input type="text" name="FirstName" size="42" />        </font></td>      </tr>      <tr>        <td width="98" align="left" valign="middle">Last Name: (<span class="style2"> *</span> )</td>        <td width="573" align="left"><font face="Arial" size="3">          <input type="text" name="LastName" size="42" />        </font></td>      </tr>      <tr>        <td colspan="2" align="left" valign="middle"><img src="seperator.jpg" width="200" height="10" /></td>        </tr>      <tr>        <td width="98" align="left" valign="middle">Email:(<span class="style2"> *</span> )</td>        <td width="573" align="left"><font face="Arial" size="3">          <input type="text" name="Email" size="42" />        </font></td>      </tr>      <tr>        <td width="98" align="left" valign="middle">Tel:</td>        <td width="573" align="left"><font face="Arial" size="3">          <input name="Tel" type="text" size="42" />        </font></td>      </tr>      <tr>        <td width="98" align="left" valign="middle">Address:</td>        <td width="573" align="left"><font size="3" face="Arial">          <input type="text" name="Address" size="42" />        </font></td>      </tr>      <tr>        <td width="98" align="left" valign="middle">Country:</td>        <td width="573" align="left"><font size="3" face="Arial">          <input type="text" name="County" size="42" />        </font></td>      </tr>      <tr>        <td width="98" align="left" valign="middle">Postcode:</td>        <td width="573" align="left"><font size="3" face="Arial">          <input type="text" name="PostCode" size="42" />        </font></td>      </tr>      <tr>        <td colspan="2" align="left" valign="middle"><img src="seperator.jpg" width="200" height="10" /></td>        </tr>      <tr>        <td width="98" align="left" valign="middle"><font face="Arial">Subject:</font></td>        <td width="573" align="left"><font size="3" face="Arial">          <select name="subject">            <option selected>General enquiry</option>            <option>Request for information</option>            <option>Request for brochure</option>            <option>Request for quotation</option>            <option>Place an order</option>            <option>Make a booking</option>            <option>Availability</option>            <option>Other</option>          </select>        </font></td>      </tr>      <tr>        <td colspan="2" align="left" valign="middle"> </td>        </tr>      <tr>        <td width="98" align="left" valign="top">Message:(<span class="style2"> *</span> )</td>        <td width="573" align="left"><font size="3" face="Arial">          <textarea accesskey="9" name="Message" rows="8" cols="60"></textarea>        </font></td>      </tr>      <tr>        <td colspan="2" align="left" valign="top"><img src="seperator.jpg" width="200" height="10" /></td>        </tr>      <tr>        <td width="98" align="left" valign="top"><font face="Arial">Contact           Preferences:</font></td>        <td width="573" align="left"><table width="300" border="0" cellspacing="3" cellpadding="0">            <tr>              <td><font face="Arial"><font size="3">                <input type="checkbox" name="Anytime" value="Yes" />              </font>Anytime</font></td>              <td><font face="Arial"><font size="3">                <input type="checkbox" name="OfficeHours" value="Yes" />              </font>Office Hours</font></td>              </tr>            <tr>              <td><font face="Arial"><font size="3">                <input type="checkbox" name="Evenings" value="Yes" />              </font>Evenings</font></td>              <td><font face="Arial"><font size="3">                <input type="checkbox" name="Weekends" value="Yes" />              </font>Weekends</font></td>              </tr>        </table></td>      </tr>      <tr>        <td colspan="2" align="left" valign="middle"><img src="seperator.jpg" width="200" height="10" /></td>        </tr>      <tr>        <td width="98" align="left" valign="middle"> </td>        <td width="573" align="left"><div align="right"><font size="3" face="Arial">          <input type="submit" name="submit" value="      Submit      " style="font-weight: 700" />        </font></div></td>      </tr>    </table></div>  </form>

 

 

 

<?php//Aquire Values$EmailTo = "info@abchsltd.co.uk";$Subject = trim(stripslashes($_POST['subject']));$Company = trim(stripslashes($_POST['Company'])); $FirstName = trim(stripslashes($_POST['FirstName'])); $LastName = trim(stripslashes($_POST['LastName'])); $Email = trim(stripslashes($_POST['Email'])); $Tel = trim(stripslashes($_POST['Tel'])); $Address = trim(stripslashes($_POST['Address'])); $County = trim(stripslashes($_POST['County'])); $PostCode = trim(stripslashes($_POST['PostCode'])); $Message = trim(stripslashes($_POST['Message'])); $Anytime = trim(stripslashes($_POST['Anytime'])); $OfficeHours = trim(stripslashes($_POST['OfficeHours'])); $Evenings = trim(stripslashes($_POST['Evenings'])); $Weekends = trim(stripslashes($_POST['Weekends'])); // Feild Validation$validationOK=true;if (trim($FirstName)=="") $validationOK=false;if (trim($LastName)=="") $validationOK=false;if (trim($Email)=="") $validationOK=false;if (trim($Message)=="") $validationOK=false;if (!$validationOK) {  print "<meta http-equiv=\"refresh\" content=\"0;URL=error.html\">";  exit;}// Email Layout$headers = "From: " . $Company ." ". $FirstName ." ". $LastName . "<" . $Email .">\r\n";$headers .= "Reply-To: " . $Email . "\r\n";$Body = "";$Body .= "Company: ";$Body .= $Company;$Body .= "\n";$Body .= "Name: ";$Body .= $FirstName;$Body .= " ";$Body .= $LastName;$Body .= "\n\n";$Body .= "Email: ";$Body .= $Email;$Body .= "\n";$Body .= "Tel: ";$Body .= $Tel;$Body .= "\n";$Body .= "Address: ";$Body .= $Address;$Body .= "\n";$Body .= "County: ";$Body .= $County;$Body .= "\n";$Body .= "PostCode: ";$Body .= $PostCode;$Body .= "\n\n";$Body .= "Subject: ";$Body .= $Subject;$Body .= "\n";$Body .= "Message: ";$Body .= $Message;$Body .= "\n\n Please Contact me at:";$Body .= "Anytime: ";$Body .= $Anytime;$Body .= "\n";$Body .= "OfficeHours: ";$Body .= $OfficeHours;$Body .= "\n";$Body .= "Evenings: ";$Body .= $Evenings;$Body .= "\n";$Body .= "Weekends: ";$Body .= $Weekends;$Body .= "\n";// Send Email $success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>");// Redirect to success page if ($success){  print "<meta http-equiv=\"refresh\" content=\"0;URL=ok.html\">";}else{  print "<meta http-equiv=\"refresh\" content=\"0;URL=error.html\">";}?>

 

Link to comment
Share on other sites

Have you checked if the server can send e-mail? Where to, do you get redirected ok.html or error.html after filling out the form? Have you checked error.log (Apache)?

 

I dont have access to the clients server details i only have the FTP details. But we were asked to redesign the site, they previously had a email form, which is the contact.php file i am using.. the only thing i have changed is the forms. but they seem fine. Redirecting seems fine the code doesnt break. the only thing we hear is that they dont recieve the email. im a complete noob to php anyway but have other programming knowledge. this has stumpd me.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.