Jump to content

Form....no emails sent...


Guest Starko

Recommended Posts

Guest Starko
Below is the code for the form, i have added the headers so i can send the form to more than one person, and now it won't send at all.

It is online at www.elliotsestateagents.co.uk/admin/sale.php

Can anyone help?

[code]<?PHP
if (isset($_POST['send'])) {
$IDNumber = $_POST['IDNumber'];
$NegotiatorName = $_POST['NegotiatorName'];
$SiteCode = $_POST['SiteCode'];
$VendorsSolicitors = $_POST['VendorsSolicitors'];
$PurchasersSolicitors = $_POST['PurchasersSolicitors'];
$FullChain = $_POST['FullChain'];
$Notes = $_POST['Notes'];

$to_email = "Sales Progressors <test@elliotsestateagents.co.uk>" . ", " ; // Note the dot!
$subject = "New Sale";
$headers = "From: $NegotiatorName <$email>\r\n";
 
/* message body */
$body = "A new sale has occured, below are all of the details:";
$body .= "________________________________________\n\n" ;
$body .= "From: ".$NegotiatorName .". " . $name ." \n";


$body .= "ID Number: ".$IDNumber."\n";
$body .= "Negotiator Name: ".$NegotiatorName."\n";
$body .= "Site Code: ".$SiteCode."\n";
$body .= "Finance: ".$Finance."\n";
$body .= "Items: ".$Items."\n";
$body .= "Full Chain: ".$FullChain."\n";
$body .= "Vendors Solicitors: ".$VendorsSolicitors."\n";
$body .= "Purchasers Solicitors: ".$PurchasersSolicitors."\n";

$body .= "Notes: ".$Notes."\n";

$body .= "________________________________________\n\n" ;
mail($to_email,$subject,$body,$headers);
}
?>[/code]
[code]<?PHP if (isset($_POST['send'])) { echo "<p><strong>Thank you for sbmiting your sale.   We will be in touch shortly.<strong/><br>
</p>
";}?></p>
 <form name="Sale" id="Sale" method="post" action="">
   <table border="0" align="left" cellpadding="2" cellspacing="2">
     <tr class="body">
       <td><div align="right"></div>
         <p>ID Number:<br />
           <input name="IDNumber" type="text" id="IDNumber" size="40" maxlength="40" />
         </p>
         <p>Negotiator Name:<br>
           <input name="NegotiatorName" type="text" id="NegotiatorName" size="40" maxlength="40" />
</p>
         <p>&nbsp;</p>
       </td>
     </tr>
     <tr class="body">
       <td>Notes:<br />
           <textarea name="Notes" cols="30" rows="4" id="Notes" style="scrollbar-base-color:blue;scrollbar-arrow-color:#990000;"></textarea></td>
     </tr>
     <tr class="body">
       <td><input name="Submit" type="submit" class="forms" style="background-color:blue; color:#FFFFFF; border-color:#FF0000" value="Submit"/>
           <input name="send" type="hidden" id="send" value="send" /></td>[/code]
Link to comment
Share on other sites

Try changing this part:
[code]$to_email = "Sales Progressors <test@elliotsestateagents.co.uk>" . ", "; // Note the dot!
$subject = "New Sale";
$headers = "From: $NegotiatorName <$email>\r\n";[/code]

To:
[code]$to_email = "Sales Progressors <test@elliotsestateagents.co.uk>" . ", "; // Note the dot!
$subject = "New Sale";
$headers = "From: ".$NegotiatorName." <".$email.">\r\n";[/code]

And I dont see why that dot and a comma in the $to_email is there. I think you can remove it, so it'll look like this:
[code]$to_email = "Sales Progressors <test@elliotsestateagents.co.uk>";[/code]

Orio.
Link to comment
Share on other sites

Try this:

[code]<?PHP
if (isset($_POST['send'])) {
$IDNumber = $_POST['IDNumber'];
$NegotiatorName = $_POST['NegotiatorName'];
$SiteCode = $_POST['SiteCode'];
$VendorsSolicitors = $_POST['VendorsSolicitors'];
$PurchasersSolicitors = $_POST['PurchasersSolicitors'];
$FullChain = $_POST['FullChain'];
$Notes = $_POST['Notes'];

$to_email = "test@elliotsestateagents.co.uk"
$subject = "New Sale";
$headers = "From: ".$NegotiatorName." <".$email.">\r\n";
 
/* message body */
$body = "A new sale has occured, below are all of the details:";
$body .= "________________________________________\n\n" ;
$body .= "From: ".$NegotiatorName.". ".$name." \n";


$body .= "ID Number: ".$IDNumber."\n";
$body .= "Negotiator Name: ".$NegotiatorName."\n";
$body .= "Site Code: ".$SiteCode."\n";
$body .= "Finance: ".$Finance."\n";
$body .= "Items: ".$Items."\n";
$body .= "Full Chain: ".$FullChain."\n";
$body .= "Vendors Solicitors: ".$VendorsSolicitors."\n";
$body .= "Purchasers Solicitors: ".$PurchasersSolicitors."\n";

$body .= "Notes: ".$Notes."\n";

$body .= "________________________________________\n\n" ;
mail($to_email,$subject,$body,$headers);
}
?>[/code]

Orio.
Link to comment
Share on other sites

Guest starko
Again its at www.elliotsestateagents.co.uk/admin/sale.php

Its coming up with an error.

Also i need the form to be sent to about 7 email addresses so i need the CC it?

Thanks.
Link to comment
Share on other sites

Guest Starko
This is all the code, but for some reason it is not sending and an error is coming up, i also need to add CC addresses.

[code]<?PHP
if (isset($_POST['send'])) {
$IDNumber = $_POST['IDNumber'];
$NegotiatorName = $_POST['NegotiatorName'];
$SiteCode = $_POST['SiteCode'];
$Notes = $_POST['Notes'];

$to_email = "chrisstarkings@elliotsestateagents.co.uk"
$subject = "New Sale";
$headers = "From: ".$NegotiatorName." <".$email.">\r\n";
 
/* message body */
$body = "A new sale has occured, below are all of the details:";
$body .= "________________________________________\n\n" ;
$body .= "From: ".$NegotiatorName.". ".$name." \n";


$body .= "ID Number: ".$IDNumber."\n";
$body .= "Negotiator Name: ".$NegotiatorName."\n";
$body .= "Site Code: ".$SiteCode."\n";
$body .= "Finance: ".$Finance."\n";
$body .= "Items: ".$Items."\n";
$body .= "Notes: ".$Notes."\n";

$body .= "________________________________________\n\n" ;
mail($to_email,$subject,$body,$headers);
}
?>[/code]
Link to comment
Share on other sites


try know ok.


<?PHP
if (isset($_POST['send'])) {
$IDNumber = $_POST['IDNumber'];
$NegotiatorName = $_POST['NegotiatorName'];
$SiteCode = $_POST['SiteCode'];
$Notes = $_POST['Notes'];

$to_email="chrisstarkings@elliotsestateagents.co.uk";
$subject="New Sale";
$headers="From: ".$NegotiatorName." <".$email.">\r\n";
 
/* message body */
$body = "A new sale has occured, below are all of the details:";
$body .= "________________________________________\n\n" ;
$body .= "From: ".$NegotiatorName.". ".$name." \n";


$body .= "ID Number: ".$IDNumber."\n";
$body .= "Negotiator Name: ".$NegotiatorName."\n";
$body .= "Site Code: ".$SiteCode."\n";
$body .= "Finance: ".$Finance."\n";
$body .= "Items: ".$Items."\n";
$body .= "Notes: ".$Notes."\n";

$body .= "________________________________________\n\n" ;
mail($to_email,$subject,$body,$headers);
}
?>
Link to comment
Share on other sites

you can try this ok but remember to make a backup of your own.


<?PHP
if (isset($_POST['send'])) {
$IDNumber = $_POST['IDNumber'];
$NegotiatorName = $_POST['NegotiatorName'];
$SiteCode = $_POST['SiteCode'];
$Notes = $_POST['Notes'];

$to_email="chrisstarkings@elliotsestateagents.co.uk";
$subject="New Sale";
$headers = 'From: $NegotiatorName' . "\r\n" .
  'Reply-To: $email' . "\r\n" .
  'X-Mailer: PHP/' . phpversion();



 
/* message body */
$body = "A new sale has occured, below are all of the details:";
$body .= "________________________________________\n\n" ;
$body .= "From: ".$NegotiatorName.". ".$name." \n";


$body .= "ID Number: ".$IDNumber."\n";
$body .= "Negotiator Name: ".$NegotiatorName."\n";
$body .= "Site Code: ".$SiteCode."\n";
$body .= "Finance: ".$Finance."\n";
$body .= "Items: ".$Items."\n";
$body .= "Notes: ".$Notes."\n";

$body .= "________________________________________\n\n" ;
mail($to_email,$subject,$body,$headers);
}
?>
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.