Jump to content

cant get cc and bcc to work on simple php mailform


shalli

Recommended Posts

Hi there

 

My clients wants me to copy the email that is sent to the customer to his sales department and the webmaster. But all I seem to get is a blank email with the subject line no message. I have tried every solution available online. But It doesnt seem to work

 

Here is my code

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>Send Quote to SF</title>

</head>

 

<body>

<?php

 

// Define $myusername and $mypassword

$buildingsum=strip_tags($_POST['buildingsum']);

$contentsum=strip_tags($_POST['contentsum']);

$rentguarantee12=strip_tags($_POST['rentguarantee12']);

$rentguarantee6=strip_tags($_POST['rentguarantee6']);

$result=strip_tags($_POST['result']);

$name=strip_tags($_POST['name']);

$address=strip_tags($_POST['address']);

$postcode=strip_tags($_POST['postcode']);

$email=strip_tags($_POST['email']);

$contactno=strip_tags($_POST['contact']);

$properties=strip_tags($_POST['properties']);

$buildvalue=strip_tags($_POST['value']);

$claims=strip_tags($_POST['claims']);

$flood=strip_tags($_POST['flood']);

$renewaldate=strip_tags($_POST['rendate']);

$premiumexpected=strip_tags($_POST['premium']);

 

// mail insurance confirmation to shalli and send the customer an email confirmation

$buildingsum=strip_tags($_POST['buildingsum']);

$contentsum=strip_tags($_POST['contentsum']);

$rentguarantee12=strip_tags($_POST['rentguarantee12']);

$rentguarantee6=strip_tags($_POST['rentguarantee6']);

$result=strip_tags($_POST['result']);

$name=strip_tags($_POST['name']);

$address==strip_tags($_POST['address']);

$postcode==strip_tags($_POST['postcode']);

$email=strip_tags($_POST['email']);

$contactno=strip_tags($_POST['contact']);

$properties=strip_tags($_POST['properties']);

$buildvalue=strip_tags($_POST['value']);

$claims=strip_tags($_POST['claims']);

$flood=strip_tags($_POST['flood']);

$renewaldate=strip_tags($_POST['rendate']);

$premiumexpected=strip_tags($_POST['premium']);

$subject="Your Legal4Landlords Quick Insurance Quote";

 

$body = "Building Sum Insured: $buildingsum

Contents Sum Insured: $contentsum,

Rent Guarantee 12: $rentguarantee12,

Rent Guarantee 6: $rentguarantee6,

Premium Quoted: $result,

Name: $name,

Address: $address,

PostCode: $postcode,

Email: $email,

Contact: $contactno,

No of Properties: $properties,

Building Value: $buildvalue,

Have you made any claims: $claims,

Has your property been flooded: $flood,

Renewal Date: $renewaldate,

Premium Expected: $premiumexpected";

 

echo "Thank Your for sumitting your insurance quote to Legal 4 Landlords Insurance Team. We will respond shortly to you shortly!" ;

 

mail($email, $subject, $body);

   

//These are the variables for the email

 

$sendto = $_POST['email']; // this is the email address collected form the form

$ccto = "[email protected]"; //copied sales into email

$bcc = "[email protected]"; //blind copy webmaster into email

$subject = "email confirmation for landlord insurance"; // Subject

 

 

// This is the function to send the email to webmaster and sales

 

$message = "Building Sum Insured: $buildingsum

Contents Sum Insured: $contentsum,

Rent Guarantee 12: $rentguarantee12,

Rent Guarantee 6: $rentguarantee6,

Premium Quoted: $result,

Name: $name,

Address: $address,

PostCode: $postcode,

Email: $email,

Contact: $contactno,

No of Properties: $properties,

Building Value: $buildvalue,

Have you made any claims: $claims,

Has your property been flooded: $flood,

Renewal Date: $renewaldate,

Premium Expected: $premiumexpected";

 

mail($ccto, $bcc, $subject, $message);

 

 

 

?>

<script language=javascript>

setTimeout("location.href='http://www.legal4landlords.com/thanks/'", [10]);

</script>

 

</body>

</html>

 

Please help I am really confused  :wtf: :wtf: :wtf: :'( :'( :'( :'(

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.