100 lines
2.5 KiB
PHP
Executable File
100 lines
2.5 KiB
PHP
Executable File
<?php
|
|
require_once 'Functions.php';
|
|
require_once 'Controleurrequete.php';
|
|
require_once 'Prestataire.php';
|
|
|
|
|
|
class Emailprestatairespublics
|
|
{
|
|
private $prestataire;
|
|
private $mail_C;
|
|
|
|
public function __construct()
|
|
{
|
|
$this->prestataire = new Prestataire();
|
|
require_once 'Ebenegmail.php';
|
|
$this->mail_C = $mail;
|
|
}
|
|
|
|
public function excutercron()
|
|
{
|
|
// $prestataires = $this->prestataire->listemailprestataire();
|
|
// $prestataires = $this->prestataire->listemailprestatairedoublon();
|
|
$prestataires = $this->prestataire->listemailprestatairepublic();
|
|
|
|
$compteur = 0;
|
|
|
|
foreach ($prestataires as $prestataire)
|
|
{
|
|
// codePrestataire, libelle, email
|
|
$compteur += 1;
|
|
|
|
$codePrestataire = $prestataire['codePrestataire'];
|
|
$libelle = $prestataire['libelle'];
|
|
$email = $prestataire['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();
|
|
|
|
// pour envoi à moi seul
|
|
// $email = "kanelazeni@gmail.com";
|
|
// fin envoi à moi seul
|
|
|
|
$addr = explode(';', $email);
|
|
foreach ($addr as $ad)
|
|
{
|
|
$mail_C->AddAddress(trim($ad) );
|
|
}
|
|
|
|
$mail_C->AddCC("prugira@radiant.rw");
|
|
$mail_C->AddCC("imugabo@radiant.rw");
|
|
$mail_C->AddCC("lkane@ebene.info");
|
|
|
|
$obejt = "RADIANT INSURANCE COMPANY : INFORMATION";
|
|
$body = "Ku bafanyabikorwa bacu mu bwishingizi bwo kwivuza,
|
|
|
|
Muraho.Dushingiye ku itegeko rishya rigenga imisoro ryasohotse mu I Gazeti numero ….yo ku wa 16/04/2018, mu ngingo yayo ya 60, twifuzaga gusaba abafatanyabikorwa bacu bose ko mwatugezaho byihutirwa C.I.T(COPERATE INCOME TAX ) (UMUSORO KUNYUNGU ) Kugirango tubashe kwishyura twubahiriza itegeko kandi twirinda ingaruka zabaho igihe amategeko atubahirijwe.
|
|
|
|
Twizeye ko mubyakira neza, mugire amahoro";
|
|
|
|
$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>';
|
|
|
|
$emailprestataires = new Emailprestatairespublics();
|
|
// date_default_timezone_set("Africa/Kigali");
|
|
$emailprestataires->excutercron();
|
|
echo "Fin Tache Cron"; |