.
require_once("../project/project.inc");
require_once("../inc/email.inc");
function replace($toname, $comment, $fromname, $template) {
$pat = array(
'/
[".tra("Use your browser's back button to return to message form")."]
";
page_tail();
} else {
page_head(tra("Sending emails"));
$found = false;
for ($i=0; $i<5; $i++) {
$n = get_str("n$i", true);
$e = get_str("e$i", true);
if ($n && $e) {
$found = true;
$mail = new PHPMailer();
$mail->AddAddress($e, $n);
$mail->Subject = $subject;
if ($html) {
$mail->Body = replace($n, $comment, $uname, $html);
$mail->AltBody = replace($n, $comment, $uname, $text);
} else {
$mail->Body = replace($n, $comment, $uname, $text);
}
$mail->From = $uemail;
$mail->FromName = $uname;
$mail->Host = $PHPMAILER_HOST;
$mail->Mailer = $PHPMAILER_MAILER;
if ($mail->Send()) {
echo "
".tra("email sent successfully to %1", $e)."\n";
} else {
echo "
".tra("failed to send email to %1: %2", $e, $mail->ErrorInfo)."\n";
}
}
}
if ($found) {
echo "
".tra("Thanks for telling your friends about %1", PROJECT); } else { echo tra("You forgot to enter your friends' names and/or email addresses; Please %1return to the form%2 and enter them.", "", ""); } page_tail(); } exit(); ?>