1
0

first commit from DTux

This commit is contained in:
Daniel Tartavel
2021-03-22 12:20:39 +01:00
parent 30fac27d45
commit 944e742590
25 changed files with 1176 additions and 0 deletions

View File

@ -0,0 +1,28 @@
<?php
require_once 'log.php';
function envoiMail($destinataire, $sujet, $text, $html=false)
{
$headers = "From: contact@avion-poe.me" . LF;
if ($html)
{
$headers .= "Content-type: text/html; charset=UTF-8" . LF;
}else
$headers .= "Content-type: text/plain; charset=UTF-8" . LF;
}
$headers .= "DATE: " . date( 'r' ) . LF . LF;
log_write(__FILE__ . __LINE__ . " Envoi d'un courriel à " . $courriel . "sujet:" . $sujet, INFO);
if( !mail($destinataire, $sujet, $text, $headers) ) //Sending mail
{
log_write(__FILE__ . EOL . __LINE__ . EOL . "Le courriel n'est pas parti:" .$courriel . EOL . $sujet . EOL, ERROR);
return 0;
}else
{
log_write(__FILE__ . EOL . __LINE__ . EOL . "Le courriel avec les pièces jointes est parti:" .$courriel . EOL, INFO);
return 1;
}
}