Esempio n. 1
0
function send_html_mail($recipients, $sender, $subject, $html, $text = null, $charset = 'windows-1251')
{
  include_once(PHPMailer_DIR . '/class.phpmailer.php');

  $mail = new PHPMailer();
  $mail->IsHTML(true);
  $mail->LE = "\r\n";//we're using php mail function!!!
  $mail->CharSet = $charset;

  $mail->Body = $html;

  if(!is_null($text))
    $mail->AltBody = $text;

  $recipients = process_mail_recipients($recipients);

  foreach($recipients as $recipient)
    $mail->AddAddress($recipient['address'], $recipient['name']);

  if(!$sender = process_mail_addressee($sender))
    return false;

  $mail->From = $sender['address'];
  $mail->FromName = $sender['name'];
  $mail->Subject = $subject;

  return $mail->Send();
}
Esempio n. 2
0
function send_html_mail($recipients, $sender, $subject, $html, $text = null, $charset = 'windows-1251')
{
  $mail =& create_mailer();
  $mail->IsHTML(true);
  $mail->CharSet = $charset;

  $mail->Body = $html;

  if(!is_null($text))
    $mail->AltBody = $text;

  $recipients = process_mail_recipients($recipients);

  foreach($recipients as $recipient)
    $mail->AddAddress($recipient['address'], $recipient['name']);

  if(!$sender = process_mail_addressee($sender))
    return false;

  $mail->From = $sender['address'];
  $mail->FromName = $sender['name'];
  $mail->Subject = $subject;

  return $mail->Send();
}
Esempio n. 3
0
function send_html_mail($recipients, $sender, $subject, $html, $text = null, $charset = 'windows-1251')
{
    $mail =& create_mailer();
    $mail->IsHTML(true);
    $mail->CharSet = $charset;
    $mail->Body = $html;
    if (!is_null($text)) {
        $mail->AltBody = $text;
    }
    $recipients = process_mail_recipients($recipients);
    foreach ($recipients as $recipient) {
        $mail->AddAddress($recipient['address'], $recipient['name']);
    }
    if (!($sender = process_mail_addressee($sender))) {
        return false;
    }
    $mail->From = $sender['address'];
    $mail->FromName = $sender['name'];
    $mail->Subject = $subject;
    if (!($res = $mail->Send())) {
        debug::write_error('mail send error', __FILE__ . ' : ' . __LINE__ . ' : ' . __FUNCTION__, $recipient);
    }
    return $res;
}