|
Hi,
Here is my problem : I can receive the mail but the Cc does not work. Somebody has an idea where I have to make the modifications?
Thanks for your help.
Here is the code.
<?php
/*
* xxxx
*/
// get required base data
$contactTime = date('d.m.Y H:i:s',time());
$contactLang = strtoupper($_POST['lng']);
$contactClub = $_POST['club'];
$contactTitle = $_POST['title'];
$contactLastName = stripslashes($_POST['lastname']);
$contactFirstName = stripslashes($_POST['firstname']);
$contactAddress = stripslashes($_POST['address']);
$contactCity = stripslashes($_POST['city']);
$contactEmail = stripslashes($_POST['email']);
$contactDayPhone = stripslashes($_POST['dayphone']);
$contactNightPhone = stripslashes($_POST['nightphone']);
switch($contactClub)
{
case 'geneva' : $mailTo = 'x@x.com';
$clubName = 'Geneva';
break;
case 'lausanne' : $mailTo = 'x@x.com';
$clubName = 'Lausanne';
break;
case 'seepark' : $mailTo = 'x@x.com';
$clubName = 'Paris';
break;
case 'zurich' : $mailTo = 'x@x.com';
$clubName = 'Zürich';
break;
case 'citygreen' : $mailTo = 'x@x.com';
$clubName = 'London';
break;
}
$redirect = '../'.strtolower($contactLang).'/thanks.html';
$mailToName = 'Place';
$mailSubject = 'place 06/04';
$mailBody = "
<b>Place 06/04</b>
<br><br>
<table cellpadding='0' cellspacing='0' border='0'>
<tr>
<td width='200'>Langue</td>
<td width='30'> : </td>
<td>$contactLang</td>
</tr>
<tr>
<td width='200'>Date/heure d'envoi</td>
<td width='30'> : </td>
<td>$contactTime</td>
</tr>
<tr>
<td colspan='3'> </td>
</tr>
<tr>
<td>Club</td>
<td> : </td>
<td>$clubName</td>
</tr>
<tr>
<td colspan='3'> </td>
</tr>
<tr>
<td>Last name</td>
<td> : </td>
<td>$contactTitle</td>
</tr>
<tr>
<td>Last name</td>
<td> : </td>
<td>$contactLastName</td>
</tr>
<tr>
<td>First name</td>
<td> : </td>
<td>$contactFirstName</td>
</tr>
<tr>
<td>Address</td>
<td> : </td>
<td>$contactAddress</td>
</tr>
<tr>
<td>Zipcode / City</td>
<td> : </td>
<td>$contactCity</td>
</tr>
<tr>
<td>E-Mail</td>
<td> : </td>
<td><a href='mailto:$contactEmail'>$contactEmail</a></td>
</tr>
<tr>
<td>Day phone</td>
<td> : </td>
<td>$contactDayPhone</td>
</tr>
<tr>
<td>Night phone</td>
<td> : </td>
<td>$contactNightPhone</td>
</tr>
</table>
"; // end mailBody
/*
* don't touch anything from here to the end of file !
*/
// finalize mail
$htmlContent = "<html>
<head>
<title>$mailSubject</title>
</head>
<body>
$mailBody
</body>
</html>"; // end finalization
// mail headers
$headers = array(
"Subject" => "$mailSubject",
"Date" => date("D, d M Y H:i:s O"),
"From" => "$contactFirstName $contactLastName <$contactEmail>",
"To" => "$mailToName <$mailTo>",
"CC" => "<xx@x.com>",
"Content-Type" => "text/html; charset=iso-8859-1"
);
// mail socket
$debug = false;
$connect = fsockopen("smtp.x.fr", 25, $errno, $errstr, 30) or die("Could not talk to the sendmail server!");
$rcv = fgets($connect, 1024);
if($debug) print("<br>[$rcv]");
fputs($connect, "EHLO romuald.x.fr\r\n");
$rcv = fgets($connect, 1024);
if($debug) print("<br>[$rcv]");
fputs($connect, "MAIL FROM:<NOREPLY@x.com>\r\n");
$rcv = fgets($connect, 1024);
if($debug) print("<br>[$rcv]");
fputs($connect, "RCPT TO:<$mailTo>\r\n");
$rcv = fgets($connect, 1024);
if($debug) print("<br>[$rcv]");
fputs($connect, "RCPT CC:<xx@x.com>\r\n");
$rcv = fgets($connect, 1024);
if($debug) print("<br>[$rcv]");
fputs($connect, "DATA\r\n");
$rcv = fgets($connect, 1024);
if($debug) print("<br>[$rcv]");
$socketheaders = "";
foreach($headers as $key=>$value )
$socketheaders .= $key.": $value\r\n";
fputs($connect, $socketheaders);
$rcv = fgets($connect, 1024);
if($debug) print("<br>[$rcv]");
fputs($connect, "\r\n".str_replace("\n","",str_replace("\r\n","",$ htmlContent))."\r\n");
$rcv = fgets($connect, 1024);
if($debug) print("<br>[$rcv]");
fputs($connect, "\r\n\r\n.\r\n");
$rcv = fgets($connect, 1024);
if($debug) print("<br>[$rcv]");
fputs($connect, "RSET\r\n");
$rcv = fgets($connect, 1024);
if($debug) print("<br>[$rcv]");
fputs($connect, "QUIT\r\n");
$rcv = fgets($connect, 1024);
if($debug) print("<br>[$rcv]");
// redirect
header("Location: $redirect");
// end form.php
?>
|