26 #require_once 'Zend/Mail/Transport/Abstract.php'; 31 #require_once 'Zend/Mime.php'; 36 #require_once 'Zend/Mime/Message.php'; 41 #require_once 'Zend/Mime/Part.php'; 185 self::$_defaultTransport = $transport;
205 self::$_defaultTransport =
null;
215 if ($charset !=
null) {
216 $this->_charset = $charset;
246 if (!in_array(
$type, $allowed)) {
250 #require_once 'Zend/Mail/Exception.php'; 254 $this->_type =
$type;
278 $this->_mimeBoundary = $boundary;
342 if (!in_array($encoding, $allowed)) {
346 #require_once 'Zend/Mail/Exception.php'; 349 $this->_headerEncoding = $encoding;
364 if ($charset ===
null) {
369 $mp->encoding = $encoding;
372 $mp->charset = $charset;
374 $this->_bodyText = $mp;
388 if ($textOnly && $this->_bodyText) {
390 return $body->getContent();
406 if ($charset ===
null) {
411 $mp->encoding = $encoding;
414 $mp->charset = $charset;
416 $this->_bodyHtml = $mp;
429 if ($htmlOnly && $this->_bodyHtml) {
431 return $body->getContent();
446 $this->hasAttachments =
true;
473 $mp->encoding = $encoding;
474 $mp->type = $mimeType;
475 $mp->disposition = $disposition;
476 $mp->filename = $filename;
490 return count($this->_parts);
527 if (isset($this->_headers[$headerName])) {
528 $this->_headers[$headerName][] =
$value;
530 $this->_headers[$headerName] = array(
$value);
534 $this->_headers[$headerName][
'append'] =
true;
562 $this->_recipients[
$email] = 1;
580 foreach (
$email as $n => $recipient) {
582 $this->_to[] = $recipient;
602 foreach (
$email as $n => $recipient) {
621 foreach (
$email as $recipient) {
635 return array_keys($this->_recipients);
646 if (isset($this->_headers[$headerName])){
647 unset($this->_headers[$headerName]);
659 $this->_recipients = array();
660 $this->_to = array();
679 if (
null !== $this->_from) {
683 #require_once 'Zend/Mail/Exception.php'; 705 if (
null !== $this->_replyTo) {
709 #require_once 'Zend/Mail/Exception.php'; 761 $this->_replyTo =
null;
776 self::$_defaultFrom = array(
'email' =>
$email,
'name' =>
$name);
796 self::$_defaultFrom =
null;
808 #require_once 'Zend/Mail/Exception.php'; 810 'No default From Address set to use');
813 $this->
setFrom($from[
'email'], $from[
'name']);
827 self::$_defaultReplyTo = array(
'email' =>
$email,
'name' =>
$name);
847 self::$_defaultReplyTo =
null;
858 if($replyTo ===
null) {
859 #require_once 'Zend/Mail/Exception.php'; 861 'No default Reply-To Address set to use');
864 $this->
setReplyTo($replyTo[
'email'], $replyTo[
'name']);
878 if ($this->_returnPath ===
null) {
880 $this->_returnPath =
$email;
886 #require_once 'Zend/Mail/Exception.php'; 901 if (
null !== $this->_returnPath) {
915 $this->_returnPath =
null;
930 if ($this->_subject ===
null) {
938 #require_once 'Zend/Mail/Exception.php'; 961 $this->_subject =
null;
977 if ($this->_date ===
null) {
978 if ($date ===
null) {
980 }
else if (is_int($date)) {
981 $date = date(
'r', $date);
982 }
else if (is_string($date)) {
983 $date = strtotime($date);
984 if ($date ===
false || $date < 0) {
988 #require_once 'Zend/Mail/Exception.php'; 990 'strtotime()-compatible');
992 $date = date(
'r', $date);
994 $date = $date->get(Zend_Date::RFC_2822);
999 #require_once 'Zend/Mail/Exception.php'; 1000 throw new Zend_Mail_Exception(__METHOD__ .
' only accepts UNIX timestamps, Zend_Date objects, ' .
1001 ' and strtotime()-compatible strings');
1003 $this->_date = $date;
1009 #require_once 'Zend/Mail/Exception.php'; 1032 $this->_date =
null;
1051 if (
$id ===
null ||
$id ===
false) {
1057 if ($this->_messageId ===
null) {
1059 $this->_messageId =
$id;
1060 $this->
_storeHeader(
'Message-Id',
'<' . $this->_messageId .
'>');
1065 #require_once 'Zend/Mail/Exception.php'; 1090 $this->_messageId =
null;
1105 if ($this->_from !==
null) {
1107 }
elseif (isset($_SERVER[
'REMOTE_ADDR'])) {
1108 $user = $_SERVER[
'REMOTE_ADDR'];
1115 if ($this->_recipients !== array()) {
1116 $recipient = array_rand($this->_recipients);
1118 $recipient =
'unknown';
1121 if (isset($_SERVER[
"SERVER_NAME"])) {
1122 $hostName = $_SERVER[
"SERVER_NAME"];
1124 $hostName = php_uname(
'n');
1127 return sha1($time .
$user . $rand . $recipient) .
'@' . $hostName;
1141 $prohibit = array(
'to',
'cc',
'bcc',
'from',
'subject',
1142 'reply-to',
'return-path',
1143 'date',
'message-id',
1145 if (in_array(strtolower(
$name), $prohibit)) {
1149 #require_once 'Zend/Mail/Exception.php'; 1178 public function send($transport =
null)
1180 if ($transport ===
null) {
1182 #require_once 'Zend/Mail/Transport/Sendmail.php'; 1189 if ($this->_date ===
null) {
1193 if(
null === $this->_from &&
null !== self::getDefaultFrom()) {
1197 if(
null === $this->_replyTo &&
null !== self::getDefaultReplyTo()) {
1201 $transport->send($this);
1214 $rule = array(
"\r" =>
'',
1234 $rule = array(
"\r" =>
'',
1253 $rule = array(
"\r" =>
'',
1274 if ($encodedName ===
$name && strcspn(
$name,
'()<>[]:;@\\,.') != strlen(
$name)) {
setFrom($email, $name=null)
static $_defaultTransport
static setDefaultReplyTo($email, $name=null)
elseif(isset( $params[ 'redirect_parent']))
addAttachment(Zend_Mime_Part $attachment)
getBodyText($textOnly=false)
setBodyText($txt, $charset=null, $encoding=Zend_Mime::ENCODING_QUOTEDPRINTABLE)
static clearDefaultTransport()
setEncodingOfHeaders($encoding)
static getDefaultTransport()
addPart(Zend_Mime_Part $part)
const ENCODING_QUOTEDPRINTABLE
_clearHeader($headerName)
static encodeQuotedPrintableHeader( $str, $charset, $lineLength=self::LINELENGTH, $lineEnd=self::LINEEND)
__construct($charset=null)
_addRecipientAndHeader($headerName, $email, $name)
getBodyHtml($htmlOnly=false)
setBodyHtml($html, $charset=null, $encoding=Zend_Mime::ENCODING_QUOTEDPRINTABLE)
createAttachment($body, $mimeType=Zend_Mime::TYPE_OCTETSTREAM, $disposition=Zend_Mime::DISPOSITION_ATTACHMENT, $encoding=Zend_Mime::ENCODING_BASE64, $filename=null)
static setDefaultTransport(Zend_Mail_Transport_Abstract $transport)
_storeHeader($headerName, $value, $append=false)
addHeader($name, $value, $append=false)
static clearDefaultFrom()
setMimeBoundary($boundary)
static getDefaultReplyTo()
static clearDefaultReplyTo()
const MULTIPART_ALTERNATIVE
setHeaderEncoding($encoding)
const DISPOSITION_ATTACHMENT
static encodeBase64Header( $str, $charset, $lineLength=self::LINELENGTH, $lineEnd=self::LINEEND)
static setDefaultFrom($email, $name=null)
setReplyTo($email, $name=null)
_formatAddress($email, $name)
if(!isset($_GET['name'])) $name