DTux
/
dtux__avion-poeme
Archived
1
0
Fork 0
This repository has been archived on 2023-11-30. You can view files and clone it, but cannot push or open issues or pull requests.
dtux__avion-poeme/include/envoi_courriel.inc.php~

27 lines
863 B
PHP

<?php
require_once 'log.php';
function envoiMail($destinataire, $sujet, $text)
{
$headers = "From: contact@avion-poe.me" . LF;
$headers .= "Content-type: text/plain; charset=UTF-8" . LF;
$headers .= "DATE: " . date( 'r' ) . LF . LF;
$html_headers = "From: contact@avion-poe.me" . LF;
$html_headers .= "Content-type: text/html; charset=UTF-8" . LF;
$html_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;
}
}