<?php
/**
 * @copyright (c) Kufer Software GmbH, Loisachstrasse 4, D-84453 Mühldorf
 */


abstract class AbstractMailSender
{
  
  protected $smtpMail;

  public function __construct($pSmtpMail)
  {
    $this->smtpMail = $pSmtpMail;
  }

  
  abstract public function send($pHeaders, $pContentPlain, $pContentHtml);

  
  public function encodeForMailHeader($string)
  {
    if (preg_match('~[\\xA0-\\xFF]~', $string)) {
      $string = '=?' . CodingOperations::getInternalEncoding() . '?B?' . base64_encode($string) . '?=';
    }

    return $string;
  }
}