94 lines
2.1 KiB
PHP
Executable File
94 lines
2.1 KiB
PHP
Executable File
<?php
|
|
require_once 'Functions.php';
|
|
require_once 'Controleurrequete.php';
|
|
require_once 'Destinataire.php';
|
|
|
|
|
|
class Emaildiverspj
|
|
{
|
|
private $destinataire;
|
|
private $mail_C;
|
|
|
|
public function __construct()
|
|
{
|
|
$this->destinataire = new Destinataire();
|
|
require_once 'Ebenegmail.php';
|
|
$this->mail_C = $mail;
|
|
}
|
|
|
|
public function excutercron()
|
|
{
|
|
$destinataires = $this->destinataire->listedestinataires();
|
|
|
|
$compteur = 0;
|
|
|
|
foreach ($destinataires as $destinataire)
|
|
{
|
|
$compteur += 1;
|
|
|
|
// $codePrestataire = $prestataire['codePrestataire'];
|
|
// $libelle = $prestataire['libelle'];
|
|
$email = $destinataire['email'];
|
|
|
|
// Pour tester
|
|
|
|
// $email = "lkane@ebene.info";
|
|
|
|
echo "$compteur $codePrestataire $libelle $email ";
|
|
echo '</BR>'; echo '</BR>';
|
|
// Fin tests */
|
|
|
|
// DEBUT ENVOI DU MAIL AVEC PIECE JOINTE
|
|
|
|
/*
|
|
|
|
$mail_C = $this->mail_C;
|
|
|
|
$mail_C->ClearAllRecipients();
|
|
|
|
$mail_C->clearAttachments();
|
|
|
|
$addr = explode(';', $email);
|
|
foreach ($addr as $ad)
|
|
{
|
|
$mail_C->AddAddress(trim($ad) );
|
|
}
|
|
|
|
$mail_C->AddCC("prugira@radiant.rw");
|
|
$mail_C->AddCC("imugabo@radiant.rw");
|
|
|
|
$obejt = "RADIANT INSURANCE COMPANY : INFORMATION";
|
|
$body = "Kubafatanya bikorwa bacu,
|
|
Twabamenyeshaga ko uwaba agifite imbongamizi akeneye ubufasha mugukoresha system nshya Intersante yasimbuye smart ko kuwagatanu sambiri le 29/6/2018 hateganyijwe amahugurwa aha kukicaro gikuru cya Radiant kuri CHIC sambiri,uwaba agifite ikibazo yakohereza umuntu akaza akongera agahugurwa.
|
|
Tubaye tubashimiye.";
|
|
|
|
$mail_C->Subject = $obejt;
|
|
|
|
$mail_C->AltBody = $altbody;
|
|
$mail_C->Body=$body;
|
|
|
|
// var_dump($mail_C);
|
|
|
|
if (!$mail_C->send())
|
|
{
|
|
// echo "Erreur mail : " . $mail_C->ErrorInfo;
|
|
}
|
|
else
|
|
{
|
|
// echo "Message envoyé!";
|
|
}
|
|
|
|
// FIN ENVOI DU MAIL AVEC PIECE JOINTE
|
|
|
|
*/
|
|
|
|
}
|
|
}
|
|
}
|
|
|
|
// echo '</BR>'; echo '</BR>';
|
|
|
|
$emaildiverspj = new Emaildiverspj();
|
|
// date_default_timezone_set("Africa/Kigali");
|
|
$emaildiverspj->excutercron();
|
|
echo "Fin Tache Cron"; |