Bonjour,

Nous avons créé des tâches CRON sur OVH, mais les mails n'arrivent pas :

Voici les logs d'erreur OVH du CRON :

[2016-12-29 18:12:02] ## OVH ## START - 2016-12-29 18:12:02.903724 executing: /usr/local/php7.0/bin/php /homez.2193/likemywora/www/tacheCron/ristourne.php
[2016-12-29 18:12:02] <html>
[2016-12-29 18:12:02] <head>
[2016-12-29 18:12:02] <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
[2016-12-29 18:12:02] <title>Test de Cron</title>
[2016-12-29 18:12:02] </head>
[2016-12-29 18:12:02] <body>
[2016-12-29 18:12:02]
[2016-12-29 18:12:02] ## OVH ## END - 2016-12-29 18:12:03.009896 exitcode: 255
[2016-12-29 18:12:02]
[2016-12-29 18:12:02] ## OVH ## Your job could not be initiated for an unknown reason. Please contact customer support for more information.
[2016-12-29 18:12:02] ## OVH ## END - 2016-12-29 18:12:03.010710 exitcode: 255
[2016-12-29 19:12:02] ## OVH ## START - 2016-12-29 19:12:02.707878 executing: /usr/local/php7.0/bin/php /homez.2193/likemywora/./www/tacheCron/ristourne.php
[2016-12-29 19:12:02] <html>
[2016-12-29 19:12:02] <head>
[2016-12-29 19:12:02] <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
[2016-12-29 19:12:02] <title>Test de Cron</title>
[2016-12-29 19:12:02] </head>
[2016-12-29 19:12:02] <body>
[2016-12-29 19:12:02]
[2016-12-29 19:12:02] ## OVH ## END - 2016-12-29 19:12:02.756471 exitcode: 255
[2016-12-29 19:12:02]
[2016-12-29 19:12:02] ## OVH ## Your job could not be initiated for an unknown reason. Please contact customer support for more information.
[2016-12-29 19:12:02] ## OVH ## END - 2016-12-29 19:12:02.757204 exitcode: 255
[2016-12-29 20:12:02] ## OVH ## START - 2016-12-29 20:12:02.755897 executing: /usr/local/php7.0/bin/php /homez.2193/likemywora/./www/tacheCron/ristourne.php
[2016-12-29 20:12:02] <html>
[2016-12-29 20:12:02] <head>
[2016-12-29 20:12:02] <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
[2016-12-29 20:12:02] <title>Test de Cron</title>
[2016-12-29 20:12:02] </head>
[2016-12-29 20:12:02] <body>
[2016-12-29 20:12:02]
[2016-12-29 20:12:02]
[2016-12-29 20:12:02]
[2016-12-29 20:12:02] ## OVH ## END - 2016-12-29 20:12:03.224268 exitcode: 255
[2016-12-29 20:12:02]
[2016-12-29 20:12:02] ## OVH ## Your job could not be initiated for an unknown reason. Please contact customer support for more information.
[2016-12-29 20:12:02] ## OVH ## END - 2016-12-29 20:12:03.225044 exitcode: 255
[2016-12-29 21:12:02] ## OVH ## START - 2016-12-29 21:12:02.616244 executing: /usr/local/php7.0/bin/php /homez.2193/likemywora/./www/tacheCron/ristourne.php
[2016-12-29 21:12:02] <html>
[2016-12-29 21:12:02] <head>
[2016-12-29 21:12:02] <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
[2016-12-29 21:12:02] <title>Test de Cron</title>
[2016-12-29 21:12:02] </head>
[2016-12-29 21:12:02] <body>
[2016-12-29 21:12:02]
[2016-12-29 21:12:02]
[2016-12-29 21:12:02]
[2016-12-29 21:12:02] ## OVH ## END - 2016-12-29 21:12:02.669607 exitcode: 255
[2016-12-29 21:12:02]
[2016-12-29 21:12:02] ## OVH ## Your job could not be initiated for an unknown reason. Please contact customer support for more information.
[2016-12-29 21:12:02] ## OVH ## END - 2016-12-29 21:12:02.670369 exitcode: 255
[2016-12-29 22:12:02] ## OVH ## START - 2016-12-29 22:12:02.683366 executing: /usr/local/php7.0/bin/php /homez.2193/likemywora/./www/tacheCron/ristourne.php
[2016-12-29 22:12:02] <html>
[2016-12-29 22:12:02] <head>
[2016-12-29 22:12:02] <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
[2016-12-29 22:12:02] <title>Test de Cron</title>
[2016-12-29 22:12:02] </head>
[2016-12-29 22:12:02] <body>
[2016-12-29 22:12:02]
[2016-12-29 22:12:02]
[2016-12-29 22:12:02]
[2016-12-29 22:12:02] ## OVH ## END - 2016-12-29 22:12:02.734003 exitcode: 255
[2016-12-29 22:12:02]
[2016-12-29 22:12:02] ## OVH ## Your job could not be initiated for an unknown reason. Please contact customer support for more information.
[2016-12-29 22:12:02] ## OVH ## END - 2016-12-29 22:12:02.734771 exitcode: 255
[2016-12-29 23:12:02] ## OVH ## START - 2016-12-29 23:12:02.661073 executing: /usr/local/php7.0/bin/php /homez.2193/likemywora/./www/tacheCron/ristourne.php
[2016-12-29 23:12:02] <html>
[2016-12-29 23:12:02] <head>
[2016-12-29 23:12:02] <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
[2016-12-29 23:12:02] <title>Test de Cron</title>
[2016-12-29 23:12:02] </head>
[2016-12-29 23:12:02] <body>
[2016-12-29 23:12:02]
[2016-12-29 23:12:02]
[2016-12-29 23:12:02]
[2016-12-29 23:12:02] ## OVH ## END - 2016-12-29 23:12:02.733093 exitcode: 255
[2016-12-29 23:12:02]
[2016-12-29 23:12:02] ## OVH ## Your job could not be initiated for an unknown reason. Please contact customer support for more information.
[2016-12-29 23:12:02] ## OVH ## END - 2016-12-29 23:12:02.733828 exitcode: 255
Et voici le code du fichier PHP qui est censé s'exécuter :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Test de Cron</title>
</head>
<body>


<?PHP
require_once("../vendor/autoload.php");
require_once ('../config/ConnexionDB.php');
$managerFacture = new ManagerFacture($pdo);
/*$req = "SELECT pro.email FROM facture fac, professionnel pro WHERE fac.num_confidentiel_pro = pro.code_confidentiel "
    . "and fac.date <= DATE_SUB( NOW(), INTERVAL 1 Hour) and pro.id_professionnel = 34 and `visible` = 0` ";*/
$req ="SELECT pro.email, fac.nom_client, fac.code_evaluation, fac.prenom_client,fac.montant_htva, fac.mail_client, fac.date, fac.num_confidentiel_pro
FROM facture fac, professionnel pro 
WHERE fac.num_confidentiel_pro = pro.code_confidentiel 
and  TO_DAYS(NOW()) - TO_DAYS(fac.date) = 10
and fac.visible = 1";
$resultats=$pdo->query($req);
$resultats->setFetchMode(PDO::FETCH_OBJ);

while( $resultat = $resultats->fetch() )
{

    $email = $resultat->email;
    /* echo $email ;*/
    //On crée une instance de la classe PHPMailer.
    $mail = new PHPMailer();
    //On change le charset.
    $mail->CharSet = 'UTF-8';
    //On précise que le contenu sera du code html.
    $mail->IsHtml(true);
    //On précise de qui vient l'email.
    $mail->setFrom("LikeMyWork@noreply.be", "LikeMyWork");
    //On change le sujet du mail.
    $mail->Subject = "1er rappel d'acceptation de formulaire de ristourne.";
    //On modifie son contenu avec l'adresse mail du client ainsi que le contenu du message du client.
    $mail->Body = '            
        <div style="position: relative; border-bottom-width: 20px ;border-right-width: 20px ;border-left-width: 20px ;border-top-width: 65px ; border-style: solid; border-color: #555; border-radius: 10px; padding: 20px 30px 60px 30px; margin:auto; max-width: 800px; width: 100%; box-sizing: border-box; background: #EEE">
            <img style="position: absolute; left: 25px; top: -60px" src="http://likemywork.be/images/logo.png" width="150" height="52"/><br/> 

            <h1 style="text-align: center; color: #3FA9F5; font-weight: bold">Rappel de payement </h1><br/>                
            
            <p>Voici le 1er rappel de payement concernant la demande de ristourne de votre client '.$resultat->nom_client.' '.$resultat->prenom_client.'.</p>
            <p>Veuillez noter que dès réception de votre payement, nous rétribuerons 2 % à '.$resultat->prenom_client.' pour avoir contribué à l’évolution de votre profil.</p>
            <p>Les 3% à verser à LikeMyWork : <b><span style=" color: #3FA9F5; font-weight=bold">' . number_format($troisPoucentAvecTva, 2, ',', '.') . '</span> EUR TVAC</b>, <br> Les 2% pour le client : <b><span style=" color: #3FA9F5; font-weight=bold">' . number_format($deuxPourcentPourClient, 2, ',', '.') . '</span> EUR</b>, <br>Ce qui fait un total de : <b><span style=" color: #3FA9F5; font-weight=bold">' .  number_format($pourcentageTotal, 2, ',', '.') . ' </span>EUR</b> sur un montant de <b>'.number_format($resultat->montant_htva, 2, ',', '.').' EUR</b></p>
            <p>Communication à mentionner sur le virement: <b><span style=" color: #3FA9F5; font-weight=bold">'.$resultat->code_evaluation.'</span></b></p><br/>
            <p>Compte en banque de LikeMyWork: BE70-3770-8002-3825 </p><br/>
            
            <p>L\'équipe LikeMyWork</p>


        <hr>
        <div style="text-align: center; color: #3FA9F5">
            <p><b><a href="http://likemywork.be/" target="_blank">www.likemywork.be</a></b></p>
        </div>

            <hr>
            <div style="text-align: center; color: #3FA9F5">
                <p><b><a href="http://likemywork.be/" target="_blank">www.likemywork.be</a></b></p>
            </div>
        </div>';

    $mail->AddAddress($email);
    $mail->send();
}
?>
</body>
</html>
Voici le contenu du fichier .ovhconfig :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
; pour plus d'informations sur ce fichier:
; http://www.ovh.com/fr/g1175.format_du_point_ovhconfig

app.engine=php
app.engine.version=7.0
http.firewall=none
environment=production
Auriez-vous une idée svp ?

Merci d'avance et bonnes fêtes.