Jump to content

contact form error


jesushax

Recommended Posts

Hi here is my code for my contact form

 

could anyone tell me if there is a problem here cos the emails arent sending :S

 

Cheers

 

<?php include($_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'); ?>

<div id="subs">
<div id="subs-text">Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nullam mollis scelerisque mi.</div>
<div id="subs-image"><img src="/images/layout/front/1.png" alt="Home Image" /></div>
</div>
<div id="backlinks"><?php include($_SERVER['DOCUMENT_ROOT'] . '/includes/backlinks.php'); ?></div>

<div id="content">
<div id="content-left">
<h3>Contact Us</h3>
<?php
switch(@$_GET["action"]) {

case "send":

$name = $_POST["txtName"];
$email = $_POST["txtEmail"];
$tel = $_POST["txtTel"];
$details = $_POST["txtDetails"];

$to = $contactemail;
$subject = "Contact Form";
$message = "
<html>
<head>
<title>HTML email</title>
</head>
<body>
<table>
  <tr>
    <td>Name:</td>
    <td>$name</td>
  </tr>
  <tr>
    <td>Email:</td>
    <td>$email</td>
  </tr>
  <tr>
    <td>Tel:</td>
    <td>$tel</td>
  </tr>
  <tr>
    <td style=\"vertical-align:top\">Details:</td>
    <td>$details</td>
  </tr>
</table>
</body>
</html>
";// Always set content-type when sending HTML email
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";// More headers
$headers .= 'From: info@cwservicesltd.co.uk' . "\r\n";
mail($to,$subject,$message,$headers);

echo '<p>your message</p>';
echo '<p>';
echo $message;
echo '</p>';
echo '<p>Has been sent and one of your friendly team will get back to you as soon as possible.</p>';

break;

default:
?>

<form method="post" id="contact" action="?action=send">
<table>
  <tr>
    <td>Name:</td>
    <td><input name="txtName" type="text" id="txtName" size="50" /></td>
  </tr>
  <tr>
    <td>Email:</td>
    <td><input name="txtEmail" type="text" id="txtEmail" size="50" /></td>
  </tr>
  <tr>
    <td>Tel:</td>
    <td><input name="txtTel" type="text" id="txtTel" size="20" /></td>
  </tr>
  <tr>
    <td style="vertical-align:top">Details:</td>
    <td><textarea name="txtDetails" id="txtDetails" cols="35" rows="7"></textarea></td>
  </tr>
  <tr>
    <td> </td>
    <td><input type="submit" name="Submit" id="Submit" value="Submit" /></td>
  </tr>
</table>
</form>
<?php 
break;
}
?>
</div>
<div id="content-right">
</div>
<?php 
include($_SERVER['DOCUMENT_ROOT'] . '/includes/footer.php');
?>

Link to comment
Share on other sites

when i send it to a address inside my doman it doesnt work

i sent it to a hotmail account it works

 

i dont fully understand ssh but know i have it set up on my account

its on a hosted server

 

what do i do with the ssh stuff?

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.