From bd7c5194260f0573678fe9fd673bc6e0faaa218f Mon Sep 17 00:00:00 2001 From: Daniel Tartavel Date: Wed, 2 Feb 2022 14:42:14 +0100 Subject: [PATCH] ajout de l'expediteur du message dans l'adresse de retour- Retrun-Path du mail --- cron.php | 4 ++-- include/envoi_courriel.inc.php | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cron.php b/cron.php index 5b13918..1223c9a 100644 --- a/cron.php +++ b/cron.php @@ -42,9 +42,9 @@ $mailText = $dicoExpe[$p['indexText']] .EOL .EOL ; print $objetMail . EOLH; print $mailText . EOLH; - envoiMail( $result['destMail'], $objetMail, $mailText, false); + envoiMail($result['expeMail'], $result['destMail'], $objetMail, $mailText, false); sleep(1); - envoiMail( $result['expeMail'], $objetMail, $mailText, true); + envoiMail("contact@avion-poe.me", $result['expeMail'], $objetMail, $mailText, true); sleep(1); } } diff --git a/include/envoi_courriel.inc.php b/include/envoi_courriel.inc.php index 9e64a2c..06a4da6 100644 --- a/include/envoi_courriel.inc.php +++ b/include/envoi_courriel.inc.php @@ -86,7 +86,8 @@ function envoiMail($destinataire, $sujet, $text, $html=false, $cc='', $bcc='') $message->setBody($text); //add date header $headers = $message->getHeaders(); - $headers->addDateHeader('Your-Header', new DateTimeImmutable('3 days ago')); + //$headers->addDateHeader('Date', new DateTimeImmutable('3 days ago')); + $headers->addPathHeader('Return-Path', $expediteur); if (!$mailer->send($message, $failures)) { echo "Failures:";