Hello.
I have been using a form handler on my website. I have a new domain and have copied the php form handler to it, with minor tweaks (the domain for the email address is different, etc). The problem is, the “cc” part of the header is not working on the new site. (It still works fine on the other one).
Can you help me figure out what’s missing? Thanks!
[php]<?php
$subject = ‘Sign Me Up’;
$emailadd = ‘[email protected]’;
$url = ‘confirmation.html’;
$req = ‘1’;
$text = “Results from form:\n\n”;
$space = ’ ';
$line = ’
‘;
foreach ($_POST as $key => $value)
{
if ($req == ‘1’)
{
if ($value == ‘’)
{echo “$key is empty”;die;}
}
$j = strlen($key);
if ($j >= 20)
{echo “Name of form element $key cannot be longer than 20 characters”;die;}
$j = 20 - $j;
for ($i = 1; $i <= $j; $i++)
{$space .= ’ ‘;}
$value = str_replace(’\n’, “$line”, $value);
$conc = “{$key}:$space{$value}$line”;
$text .= $conc;
$space = ’ ';
}
$headers = ‘Cc: [email protected]’ . “\r\n”;
mail($emailadd, $subject, $text, ‘From: ‘.$emailadd.’’, $headers);
$email = $_POST[‘Email’];
$subject = ‘We will be in contact with you shortly’;
$text = 'Dear Business Owner,
Your request for more information has been received. One of our representatives will be in contact with you shortly!’;
mail($email, $subject, $text, ‘From: ‘.$emailadd.’’);
echo ‘’;
?>
[/php]
What gives? Why would the “cc” function work on one website and not another?