<?php
/***************************************************************************
- * Copyright (C) 2003-2004 Polytechnique.org *
+ * Copyright (C) 2003-2006 Polytechnique.org *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
// {{{ get_all_redirects
-function get_all_redirects($membres, $mls, $alias, &$client)
+function get_all_redirects($membres, $mls, &$client)
{
global $globals;
foreach ($mls as $ml) {
if (list(,$members) = $client->get_members($ml)) {
foreach ($members as $mem) {
- list($m, $dom) = split('@',$mem[1]);
+ list($m, $dom) = explode('@',$mem[1]);
if ($dom == $globals->mail->domain || $dom == $globals->mail->domain2) {
$res = $globals->xdb->query('SELECT prenom, nom, FIND_IN_SET("femme", u.flags) AS sexe
FROM auth_user_md5 AS u
// }}}
// {{{ _send_xnet_mail
-function _send_xnet_mail($user, $body, $mailer)
+function _send_xnet_mail($user, $body, $mailer, $replyto = null)
{
$cher = isset($user['sexe']) ? ($user['sexe'] ? 'Chère' : 'Cher') : 'Cher(e)';
$nom = isset($user['nom']) ? $user['nom'] : "";
$text = preg_replace('!<prenom>!i', $pnom, $text);
$mailer->addHeader('To', $to);
+ if ($replyto) {
+ $mailer->addHeader('Reply-To', $replyto);
+ }
$mailer->setTxtBody(wordwrap($text, 72));
$mailer->send();
}
// }}}
// {{{ send_xnet_mails
-function send_xnet_mails($from, $sujet, $body, $tos)
+function send_xnet_mails($from, $sujet, $body, $tos, $replyto = null)
{
$sent = array();
foreach ($tos as $user) {
if ($sent[$user['email']]) continue;
- _send_xnet_mail($user, $body, $mailer);
+ _send_xnet_mail($user, $body, $mailer, $replyto);
$sent[$user['email']] = true;
}
}