Commit 1a0824bf authored by David Anderson's avatar David Anderson

web: fix bug in family/friends email feature

parent 14f462b4
......@@ -66,23 +66,30 @@ if ($action=='Preview') {
$n = get_str("n$i", true);
$e = get_str("e$i", true);
if ($n && $e) {
$body = replace($n, $comment, $uname, $html);
$found = true;
$mail = make_php_mailer();
$mail->AddAddress($e, $n);
$mail->Subject = $subject;
if ($html) {
$mail->Body = replace($n, $comment, $uname, $html);
$mail->AltBody = replace($n, $comment, $uname, $text);
if (function_exists("make_php_mailer")) {
$mail = make_php_mailer();
$mail->AddAddress($e, $n);
$mail->Subject = $subject;
if ($html) {
$mail->Body = $body;
$mail->AltBody = replace($n, $comment, $uname, $text);
} else {
$mail->Body = replace($n, $comment, $uname, $text);
}
$mail->From = $uemail;
$mail->FromName = $uname;
if (!$mail->Send()) {
echo "<br>".tra("failed to send email to %1: %2", $e, $mail->ErrorInfo)."\n";
continue;
}
} else {
$mail->Body = replace($n, $comment, $uname, $text);
}
$mail->From = $uemail;
$mail->FromName = $uname;
if ($mail->Send()) {
echo "<br>".tra("email sent successfully to %1", $e)."\n";
} else {
echo "<br>".tra("failed to send email to %1: %2", $e, $mail->ErrorInfo)."\n";
if (!mail($e, $subject, $body, "$uname <$uemail>")) {
echo "<br>".tra("failed to send email to %1", $e)."\n";
}
}
echo "<br>".tra("email sent successfully to %1", $e)."\n";
}
}
if ($found) {
......
......@@ -16,9 +16,9 @@
// You should have received a copy of the GNU Lesser General Public License
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
// TODO: - find out if this is used (add some logging mechanism or so)
// - if used rewrite code to use display functions from util.inc
// - if used find a way to give the user a language choice (projects must translate messages themself)
// TODO: - add a logging mechanism to see if people are using this.
// - use display functions from util.inc
// - give the user a language choice
require_once("../inc/util.inc");
......
......@@ -121,6 +121,7 @@ function show_nav() {
}
echo "
<li><a href=\"user_search.php\">User search</a>
<li><a href=ffmail_form.php>Share</a>
";
if (!DISABLE_FORUMS) {
echo "
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment