j essaye d envoyer un mail sur ma messagerie
j ai essaye avec ce code
cela fonctionne
je reçois bien le mail
mais dans l entête il est indique "nous ne pouvons pas obtenir d aperçu"
voici le code
c est surement encore un detail
Code : Tout sélectionner
//l'envoie du mail
if(!empty($_POST["send"])) {
// senders info
$name = $_POST["name"];
$email = $_POST["email"];
// recipients info
$toEmail = "[email protected]";
$subject = $_POST["subject"];
$drone = $_POST["drone"];
$drone1 = $_POST["drone1"];
$drone3 = $_POST["drone3"];
$drone4 = $_POST["drone4"];
$drone5 = $_POST["drone5"];
$message= '<html>
<head>
<title><?php echo $subject; ?></title>
</head>
<body>
<?php
echo \'<table align="center" cellspacing="3" cellpadding="3" width="100">
<tr>
<th align="left"><b>Player Name<b></td>
<th align="left"><b>Number of Goals<b></td>
</tr>\';
echo \'<tr>
<td align="left">\' . $_POST["drone5"]. \'</td>
<td align="left">\' . $_POST["drone5"]. \'</td>
</tr>\';
// Close the table:
echo \'</table>\';
?>
</body>
</html>';
// headers
$headers = "From: $name <$email>\r\n";
$Headers = "From: " . $name . "<". $email .">\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
// attempt to send the email
if(mail($toEmail,$subject,$message,$headers)){
// success message
echo "Success!<br />";
}else{
// error message
echo "Fail<br />";
}
}