HI all, i try to make a script they will send a email when the day will be match with the person birthday in my database. I have a CRON for send automatically. but at the base my script doesnt work.
Can someone they can help me ?
<?php
include 'fonctions.php';
brancher();
$query="SELECT * FROM bdphoto WHERE office='Québec'";
$result=mysql_query($query);
$dimension=mysql_num_rows($result);
for ($i=0;$i<$dimension;$i++)
{
$tableau=mysql_fetch_array($result);
$tempo1=date("dF");
if ($tableau[11]=='janvier'){$tempo3='january';}
if ($tableau[11]=='fevrier'){$tempo3='febuary';}
if ($tableau[11]=='mars'){$tempo3='march';}
if ($tableau[11]=='avril'){$tempo3='april';}
if ($tableau[11]=='mai'){$tempo3='may';}
if ($tableau[11]=='juin'){$tempo3='june';}
if ($tableau[11]=='juillet'){$tempo3='july';}
if ($tableau[11]=='août'){$tempo3='august';}
if ($tableau[11]=='septembre'){$tempo3='september';}
if ($tableau[11]=='octobre'){$tempo3='october';}
if ($tableau[11]=='novembre'){$tempo3='november';}
if ($tableau[11]=='décembre'){$tempo3='december';}
$tempo2=$tableau[10].$tempo3;
echo 'Marqueur'.$tempo2;
echo 'Marqueur'.$tempo1;
echo 'Marqueur'.$tempo3;
echo 'Marqueur'.$tempo1;
if ($tempo2==$tempo1)
{
// Plusieurs destinataires
$to='alefraser@deloitte.ca'; // notez la virgule
// Sujet
$subject = 'Bonne Fête !';
// message
$message = '
<html>
<head>
<title>Bonne Fête !</title>
<style type="text/css">
<!--
.Style2 {font-size: 12px; font-family: Arial;}
.Style3 {
color: #0099FF;
font-size: 14px;
font-family: Arial;
}
-->
</style>
</head>
<body>
<p><img src="http://portailinfoqc/pic/banner.jpg" width="640" height="80"></p>
<p><strong> </strong></p>
<p class="Style2"> </p>
<p class="Style3"> Bonjour PATATE, </p>
<p class="Style3"> En cette journée du « PATATE », le moment est idéal pour souhaiter sincèrement à quelqu’un de spécial d’être comblé chaleureusement. </p>
<p class="Style3"> Bonne Fête à toi ! </p>
<p class="Style3"> </p>
<p class="Style3"> Les associés et le personnel du cabinet… </p>
<p><img src="http://portailinfoqc/pic/bonnefete.jpg"> <strong> </strong></p>
</body>
</html>
';
// Pour envoyer un mail HTML, l'en-tête Content-type doit être défini
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
// En-têtes additionnels
$headers .= 'From: Club Social Sam Touche' . "\r\n";
// Envoi
mail($to, $subject, $message, $headers);
echo 'envoyé'.$to.$subject.$message.$headers;
}
}
?>