1
0

ajout de l'expediteur du message dans l'adresse de retour- Return-Path du mail

This commit is contained in:
Daniel Tartavel 2022-02-02 14:43:34 +01:00
parent bd7c519426
commit 276a21b3a3

View File

@ -20,7 +20,7 @@ function courrielEnvoi( $db )
$mailText = $result['text']; $mailText = $result['text'];
$html = $result['html']; $html = $result['html'];
saveMail( $db, $db->expeMail, $objetMail, $mailText, $html); saveMail( $db, "contact@avion-poe.me", $db->expeMail, $objetMail, $mailText, $html);
//log_write(print_r($db,true)); //log_write(print_r($db,true));
@ -47,16 +47,16 @@ function courrielEnvoi( $db )
{ {
$message = "<html><head></head>\n<body>" . $message . "</body></html>"; $message = "<html><head></head>\n<body>" . $message . "</body></html>";
} }
saveMail( $db, $db->destMail, $objetMail, $mailText, $html); saveMail( $db, $db->expeMail, $db->destMail, $objetMail, $mailText, $html);
} }
function saveMail( $db, $destinataire, $objet, $text, $html=false) function saveMail( $db, $expediteur, $destinataire, $objet, $text, $html=false)
{ {
$query = "INSERT INTO courriels VALUES ('0', '" . $db->protect($destinataire) . "', '" . $db->protect($objet) . "', '" . $db->protect($text) . "', '" . (int)$html . "')"; $query = "INSERT INTO courriels VALUES ('0', '" . $db->protect($destinataire) . "', '" . $db->protect($objet) . "', '" . $db->protect($text) . "', '" . (int)$html . "')";
$db->query($query); $db->query($query);
} }
function envoiMail($destinataire, $sujet, $text, $html=false, $cc='', $bcc='') function envoiMail($expediteur,$destinataire, $sujet, $text, $html=false, $cc='', $bcc='')
{ {
require_once 'include/swiftmailer/autoload.php'; require_once 'include/swiftmailer/autoload.php';
//require_once 'include/swiftmailer/swiftmailer/lib/swift_init.php'; //require_once 'include/swiftmailer/swiftmailer/lib/swift_init.php';