Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $bdd = new PDO('mysql:host=localhost;dbname=reportin', '******', '******');
- include("connexion.php");
- require 'PHPMailerAutoload.php';
- $sql= $bdd->query('SELECT count(id) as id from incident where retour="0" AND
- atelier IN("BC1","Four 1","Refoidisseur 1","Charbon A","Charbon B","Comm
- Charbon")');
- $data = $sql->fetch();
- $mail = new PHPMailer;
- $mail->SMTPDebug = 3;
- $mail->isSMTP();
- $mail->Host = '******';
- $mail->SMTPAuth = true;
- $mail->Username = '******';
- $mail->Password = '*******';
- $mail->SMTPSecure = 'tls';
- $mail->Port = 587;
- $mail->setFrom('******');
- $mail->addAddress('******', 'name');
- $mail->Subject = ' valider';
- $mail->Body = "
- <table>
- <thead>
- <tr>
- <th> Destinataire |</th>
- <th> Atelier |</th>
- <th> Anomalie
- </th>
- </tr>
- </thead>
- ";
- foreach($data as $raw) {
- $destinataire=$raw['destinataire'];
- $atelier=$raw['atelier'];
- $anomalie=$raw['anomalie'];
- $mail->Body .="
- <tr>
- <td> ".$destinataire."</td>
- <td> ".$atelier." </td>
- <td> ".$anomalie." </td>
- </tr>
- </table>
- @endforeach
- ";
- }
- $mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
- if(!$mail->send()) {
- echo 'Message could not be sent.';
- echo 'Mailer Error : ' . $mail->ErrorInfo;
- } else {
- echo 'Message has been sent';
- }
- Warning: Illegal string offset 'destinataire' in
- /home/reporting/public_html/bsk/sendemail/sendEmail.php on line 41
- Warning: Illegal string offset 'atelier' in
- /home/reporting/public_html/bsk/sendemail/sendEmail.php on line 42
- Warning: Illegal string offset 'anomalie' in
- /home/reporting/public_html/bsk/sendemail/sendEmail.php on line 43
- Warning: Illegal string offset 'destinataire' in
- /home/reporting/public_html/bsk/sendemail/sendEmail.php on line 41
- Warning: Illegal string offset 'atelier' in
- /home/reporting/public_html/bsk/sendemail/sendEmail.php on line 42
- Warning: Illegal string offset 'anomalie' in
- /home/reporting/public_html/bsk/sendemail/sendEmail.php on line 43
- Message has been sent
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement