function zenphoto_PHPMailer($msg, $email_list, $subject, $message, $from_mail, $from_name, $cc_addresses, $replyTo, $html = false)
{
require_once dirname(__FILE__) . '/PHPMailer/class.phpmailer.php';
switch (getOption('PHPMailer_mail_protocol')) {
case 'pop3':
require_once dirname(__FILE__) . '/PHPMailer/class.pop3.php';
$pop = new POP3();
$authorized = $pop->Authorise(getOption('PHPMailer_server'), getOption('PHPMailer_pop_port'), 30, getOption('PHPMailer_user'), getOption('PHPMailer_password'), 0);
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->Port = getOption('PHPMailer_smtp_port');
$mail->Host = getOption('PHPMailer_server');
break;
case 'smtp':
$mail = new PHPMailer();
$mail->SMTPAuth = true;
// enable SMTP authentication
$mail->IsSMTP();
$mail->Username = getOption('PHPMailer_user');
$mail->Password = getOption('PHPMailer_password');
$mail->Host = getOption('PHPMailer_server');
$mail->Port = getOption('PHPMailer_smtp_port');
break;
case 'sendmail':
$mail = new PHPMailer();
$mail->IsSendmail();
break;
}
$mail->SMTPSecure = getOption('PHPMailer_secure');
$mail->CharSet = 'UTF-8';
$mail->From = $from_mail;
$mail->FromName = $from_name;
$mail->Subject = $subject;
$mail->Body = $message;
$mail->AltBody = '';
$mail->IsHTML($html);
foreach ($email_list as $to_name => $to_mail) {
if (is_numeric($to_name)) {
$mail->AddAddress($to_mail);
} else {
$mail->AddAddress($to_mail, $to_name);
}
}
if (count($cc_addresses) > 0) {
foreach ($cc_addresses as $cc_name => $cc_mail) {
$mail->AddCC($cc_mail);
}
}
if ($replyTo) {
$names = array_keys($replyTo);
$mail->AddReplyTo(array_shift($replyTo), array_shift($names));
}
if (!$mail->Send()) {
if (!empty($msg)) {
$msg .= '<br />';
}
$msg .= sprintf(gettext('<code>PHPMailer</code> failed to send <em>%1$s</em>. ErrorInfo:%2$s'), $subject, $mail->ErrorInfo);
}
return $msg;
}