Problème d' HTML
youngIT
Messages postés
7
Date d'inscription
Statut
Membre
Dernière intervention
-
jordane45 Messages postés 38486 Date d'inscription Statut Modérateur Dernière intervention -
jordane45 Messages postés 38486 Date d'inscription Statut Modérateur Dernière intervention -
Bonjour, je suis stagiaire et j'ai modifier un fichier .php pour , après avoir corrigé quelques petite erreur
je lance la commande php -f xxxxxx
et cela m'affiche " fatal: root(0): No recipient addresses found in message header"
mais je ne comprend pas ce message, besoin d'aide.
Merci à ceux qui me réponde
je lance la commande php -f xxxxxx
et cela m'affiche " fatal: root(0): No recipient addresses found in message header"
mais je ne comprend pas ce message, besoin d'aide.
Merci à ceux qui me réponde
A voir également:
- Problème d' HTML
- Editeur html - Télécharger - HTML
- Espace html ✓ - Forum HTML
- [**] Balise pour un espace vide en hml. Merci ✓ - Forum Webmastering
- /Var/www/html/index.html ✓ - Forum Linux / Unix
- Html download - Télécharger - HTML
5 réponses
Bonjour,
Sans voir le script ..impossible de te répondre ...
( pour poster ton script sur le forum, tu devras utiliser les balises de code : https://codes-sources.commentcamarche.net/faq/11288-les-balises-de-code )
Mais vu le message .. ce script n'est-il pas sensé envoyer un mail ?
Et dans ce cas, il semble que tu n'ais pas précisé de destinataire pour le mail.. d'où le message d'erreur...
Sans voir le script ..impossible de te répondre ...
( pour poster ton script sur le forum, tu devras utiliser les balises de code : https://codes-sources.commentcamarche.net/faq/11288-les-balises-de-code )
Mais vu le message .. ce script n'est-il pas sensé envoyer un mail ?
Et dans ce cas, il semble que tu n'ais pas précisé de destinataire pour le mail.. d'où le message d'erreur...
#!/opt/rh/rh-php72/root/usr/bin/php -c /etc/opt/rh/rh-php72/php.ini
<? php
array_shift ( $ argv );
$ f_notify_type = array_shift ( $ argv );
$ f_host_name = array_shift ( $ argv );
$ f_host_alias = array_shift ( $ argv );
$ f_host_state = array_shift ( $ argv );
$ f_host_address = array_shift ( $ argv );
$ f_host_output = array_shift ( $ argv );
$ f_long_date = array_shift ( $ argv );
$ f_serv_desc = array_shift ( $ argv );
$ f_serv_state = array_shift ( $ argv );
$ f_to = array_shift ( $ argv );
$ f_totalup = array_shift ( $ argv );
$ f_totaldown = array_shift ( $ argv );
$ f_ackauthor = array_shift ( $ argv );
$ f_ackcomment = array_shift ( $ argv );
if ( $ f_host_state == " RECOVERY " ) { $ f_color = "#f48400" ;}
if ( $ f_host_state == "DOWN" ) { $ f_color = "#f40000" ;}
if ( $ f_host_state == "UP" ) { $ f_color = "#00b71a" ;}
$ subject = "[CENTREON] $ f_notify_type Host: $ f_host_name" ;
$ url = " " ;
$ from = " " ;
$ body = "<html> <body> <table border = 0 width = '98% 'cellpadding = 0 cellspacing = 0> <tr> <td valign =' top '> \ r \ n" ;
$ body . = "<table border = 0 cellpadding = 0 cellspacing = 0 width = '98% '>" ;
$ body . = "<tr bgcolor = $ f_color> <td width = '140'> <b> <font color = # ffffff> Hôte: </font></b></td> <td> <police color = # ffffff> <b> $ f_notify_type [$ f_host_state] </b> </font> </td> </tr> \ r \ n " ;
if ( $ f_ackauthor ! = "" && $ f_ackcomment ! = "" ) {
$ body . = "<tr bgcolor = $ f_color> <td width = '140'> <b> <font color = # ffffff> $ f_ackauthor: </font> </b> </td> <td> <font color = # ffffff> <b> $ f_ackcomment </b> </font> </td> </tr> \ r \ n " ;
}
$ body . = "<tr bgcolor = # eeeeee> <td> <b> Nom d'hôte: </b></td><td> <b> <a href = '$ url / centreon / main.php? p = 20202 & o = hd & host_name = $ f_host_name '> $ f_host_alias </a> </b></td> </tr> \ r \ n " ;
$ body . = "<tr bgcolor = # fefefe> <td> <b> Adresse: </b></td><td><b>$f_host_address</b></td> </tr> \ r \ n " ;
$ body . = "<tr bgcolor = # eeeeee> <td> <b> Date / Heure: </b></td><td>$f_long_date</td> </tr> \ r \ n" ;
$ body . = "<tr bgcolor = # fefefe> <td> <b> Infos: </b></td> <td> <font color = $ f_color> $ f_host_output </font> </td> </ tr> \ r \ n " ;
$ body . = "<tr bgcolor = # eeeeee> <td> <b> Nombre total d'hôtes en activité: </b></td><td>$f_totalup</td> </tr> \ r \ n" ;
$ body . = "<tr bgcolor = # fefefe> <td> <b> Nombre total d'hôtes en panne: </b></td><td>$f_totaldown</td> </tr> \ r \ n" ;
$ body . = "<tr bgcolor = # eeeeee> <td> <b> Actions: </b></td> <td> <a href = '$ url / centreon / main.php? p = 20201 & o = hd & nom_hôte = $ f_host_name '> <b> Reconnaître </b> </a> </td> </tr> \ r \ n " ;
$ body . = "</table> </table> </body> </html> \ r \ n" ;
$ headers = "De: $ de \ r \ n" ;
$ headers = $ headers . "Type de contenu: texte / html \ r \ n" ;
/ * Envoyer un e-mail maintenant ... * /
mail ( $ f_to , $ subject , $ body , $ headers );
?>
<? php
array_shift ( $ argv );
$ f_notify_type = array_shift ( $ argv );
$ f_host_name = array_shift ( $ argv );
$ f_host_alias = array_shift ( $ argv );
$ f_host_state = array_shift ( $ argv );
$ f_host_address = array_shift ( $ argv );
$ f_host_output = array_shift ( $ argv );
$ f_long_date = array_shift ( $ argv );
$ f_serv_desc = array_shift ( $ argv );
$ f_serv_state = array_shift ( $ argv );
$ f_to = array_shift ( $ argv );
$ f_totalup = array_shift ( $ argv );
$ f_totaldown = array_shift ( $ argv );
$ f_ackauthor = array_shift ( $ argv );
$ f_ackcomment = array_shift ( $ argv );
if ( $ f_host_state == " RECOVERY " ) { $ f_color = "#f48400" ;}
if ( $ f_host_state == "DOWN" ) { $ f_color = "#f40000" ;}
if ( $ f_host_state == "UP" ) { $ f_color = "#00b71a" ;}
$ subject = "[CENTREON] $ f_notify_type Host: $ f_host_name" ;
$ url = " " ;
$ from = " " ;
$ body = "<html> <body> <table border = 0 width = '98% 'cellpadding = 0 cellspacing = 0> <tr> <td valign =' top '> \ r \ n" ;
$ body . = "<table border = 0 cellpadding = 0 cellspacing = 0 width = '98% '>" ;
$ body . = "<tr bgcolor = $ f_color> <td width = '140'> <b> <font color = # ffffff> Hôte: </font></b></td> <td> <police color = # ffffff> <b> $ f_notify_type [$ f_host_state] </b> </font> </td> </tr> \ r \ n " ;
if ( $ f_ackauthor ! = "" && $ f_ackcomment ! = "" ) {
$ body . = "<tr bgcolor = $ f_color> <td width = '140'> <b> <font color = # ffffff> $ f_ackauthor: </font> </b> </td> <td> <font color = # ffffff> <b> $ f_ackcomment </b> </font> </td> </tr> \ r \ n " ;
}
$ body . = "<tr bgcolor = # eeeeee> <td> <b> Nom d'hôte: </b></td><td> <b> <a href = '$ url / centreon / main.php? p = 20202 & o = hd & host_name = $ f_host_name '> $ f_host_alias </a> </b></td> </tr> \ r \ n " ;
$ body . = "<tr bgcolor = # fefefe> <td> <b> Adresse: </b></td><td><b>$f_host_address</b></td> </tr> \ r \ n " ;
$ body . = "<tr bgcolor = # eeeeee> <td> <b> Date / Heure: </b></td><td>$f_long_date</td> </tr> \ r \ n" ;
$ body . = "<tr bgcolor = # fefefe> <td> <b> Infos: </b></td> <td> <font color = $ f_color> $ f_host_output </font> </td> </ tr> \ r \ n " ;
$ body . = "<tr bgcolor = # eeeeee> <td> <b> Nombre total d'hôtes en activité: </b></td><td>$f_totalup</td> </tr> \ r \ n" ;
$ body . = "<tr bgcolor = # fefefe> <td> <b> Nombre total d'hôtes en panne: </b></td><td>$f_totaldown</td> </tr> \ r \ n" ;
$ body . = "<tr bgcolor = # eeeeee> <td> <b> Actions: </b></td> <td> <a href = '$ url / centreon / main.php? p = 20201 & o = hd & nom_hôte = $ f_host_name '> <b> Reconnaître </b> </a> </td> </tr> \ r \ n " ;
$ body . = "</table> </table> </body> </html> \ r \ n" ;
$ headers = "De: $ de \ r \ n" ;
$ headers = $ headers . "Type de contenu: texte / html \ r \ n" ;
/ * Envoyer un e-mail maintenant ... * /
mail ( $ f_to , $ subject , $ body , $ headers );
?>
voila dsl c'est un peut long, mais sisi je reçois bien le mais lorsque que j'ai une alerte
Tu n'as pas correctement utiliser les balises de code c'est dommage ça rend le code beaucoup moins lisible...
Quoi qu'il en soit le souci concerne l'utilisation du script en ligne de commande que tu as essayé...
Ce script attends plusieurs paramètres dont le destinataire du mail forcément si tu ne mets pas tous les paramètres lorsque tu lance la ligne de commande à la main tu as une erreur..
Quoi qu'il en soit le souci concerne l'utilisation du script en ligne de commande que tu as essayé...
Ce script attends plusieurs paramètres dont le destinataire du mail forcément si tu ne mets pas tous les paramètres lorsque tu lance la ligne de commande à la main tu as une erreur..
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question