Actuellement, quand le forum envoie une notification email, il l'envoie avec comme expéditeur frederic@letellier.org.
J'aimerais modifier le forum pour que la notification provienne de "Forum abandonware.org <frederic@letellier.org>".
Est-ce que quelqu'un sait comment faire ce type de modification avec phpBB 3 ?
Sur Internet, j'ai trouvé des gens qui conseillaient de modifier le fichier functions_messenger.php, mais après modification, l'envoi des mails ne se fait plus. J'ai essayé les 2 modifications suivantes :
Code : Tout sélectionner
/**
* Return email header
*/
function build_header($to, $cc, $bcc)
{
global $config;
// We could use keys here, but we won't do this for 3.0.x to retain backwards compatibility
$headers = array();
$headers[] = 'From: Forum abandonware.org' . $this->from;
if ($cc)
{
$headers[] = 'Cc: ' . $cc;
}
if ($bcc)
{
$headers[] = 'Bcc: ' . $bcc;
}
$headers[] = 'Reply-To: ' . $this->replyto;
$headers[] = 'Return-Path: <' . $config['board_email'] . '>';
$headers[] = 'Sender: <' . $config['board_email'] . '>';
$headers[] = 'MIME-Version: 1.0';
$headers[] = 'Message-ID: <' . md5(unique_id(time())) . '@' . $config['server_name'] . '>';
$headers[] = 'Date: ' . date('r', time());
$headers[] = 'Content-Type: text/plain; charset=UTF-8'; // format=flowed
$headers[] = 'Content-Transfer-Encoding: 8bit'; // 7bit
$headers[] = 'X-Priority: ' . $this->mail_priority;
$headers[] = 'X-MSMail-Priority: ' . (($this->mail_priority == MAIL_LOW_PRIORITY) ? 'Low' : (($this->mail_priority == MAIL_NORMAL_PRIORITY) ? 'Normal' : 'High'));
$headers[] = 'X-Mailer: phpBB3';
$headers[] = 'X-MimeOLE: phpBB3';
$headers[] = 'X-phpBB-Origin: phpbb://' . str_replace(array('http://', 'https://'), array('', ''), generate_board_url());
if (sizeof($this->extra_headers))
{
$headers = array_merge($headers, $this->extra_headers);
}
return $headers;
}
Code : Tout sélectionner
/**
* Return email header
*/
function build_header($to, $cc, $bcc)
{
global $config;
// We could use keys here, but we won't do this for 3.0.x to retain backwards compatibility
$headers = array();
$headers[] = 'From: ' . $this->from;
if ($cc)
{
$headers[] = 'Cc: ' . $cc;
}
if ($bcc)
{
$headers[] = 'Bcc: ' . $bcc;
}
$headers[] = 'Reply-To: ' . $this->replyto;
$headers[] = 'Return-Path: <' . $config['board_email'] . '>';
$headers[] = 'Sender: Forum abandonware.org <' . $config['board_email'] . '>';
$headers[] = 'MIME-Version: 1.0';
$headers[] = 'Message-ID: <' . md5(unique_id(time())) . '@' . $config['server_name'] . '>';
$headers[] = 'Date: ' . date('r', time());
$headers[] = 'Content-Type: text/plain; charset=UTF-8'; // format=flowed
$headers[] = 'Content-Transfer-Encoding: 8bit'; // 7bit
$headers[] = 'X-Priority: ' . $this->mail_priority;
$headers[] = 'X-MSMail-Priority: ' . (($this->mail_priority == MAIL_LOW_PRIORITY) ? 'Low' : (($this->mail_priority == MAIL_NORMAL_PRIORITY) ? 'Normal' : 'High'));
$headers[] = 'X-Mailer: phpBB3';
$headers[] = 'X-MimeOLE: phpBB3';
$headers[] = 'X-phpBB-Origin: phpbb://' . str_replace(array('http://', 'https://'), array('', ''), generate_board_url());
if (sizeof($this->extra_headers))
{
$headers = array_merge($headers, $this->extra_headers);
}
return $headers;
}