29 parent::__construct($headers, $encoder, $cache, $grammar, $charset);
34 'DomainKey-Signature',
46 'Content-Transfer-Encoding',
48 $this->
getHeaders()->setAlwaysDisplayed(array(
'Date',
'Message-ID',
'From'));
49 $this->
getHeaders()->addTextHeader(
'MIME-Version',
'1.0');
62 return self::LEVEL_TOP;
75 $this->
getHeaders()->addTextHeader(
'Subject', $subject);
101 $this->
getHeaders()->addDateHeader(
'Date', $date);
127 $this->
getHeaders()->addPathHeader(
'Return-Path', $address);
155 if (!is_array($address) && isset($name)) {
156 $address = array($address => $name);
160 $this->
getHeaders()->addMailboxHeader(
'Sender', (array) $address);
186 public function addFrom($address, $name = null)
189 $current[$address] = $name;
191 return $this->
setFrom($current);
207 public function setFrom($addresses, $name = null)
209 if (!is_array($addresses) && isset($name)) {
210 $addresses = array($addresses => $name);
214 $this->
getHeaders()->addMailboxHeader(
'From', (array) $addresses);
243 $current[$address] = $name;
263 if (!is_array($addresses) && isset($name)) {
264 $addresses = array($addresses => $name);
268 $this->
getHeaders()->addMailboxHeader(
'Reply-To', (array) $addresses);
294 public function addTo($address, $name = null)
296 $current = $this->
getTo();
297 $current[$address] = $name;
299 return $this->
setTo($current);
316 public function setTo($addresses, $name = null)
318 if (!is_array($addresses) && isset($name)) {
319 $addresses = array($addresses => $name);
323 $this->
getHeaders()->addMailboxHeader(
'To', (array) $addresses);
349 public function addCc($address, $name = null)
351 $current = $this->
getCc();
352 $current[$address] = $name;
354 return $this->
setCc($current);
368 public function setCc($addresses, $name = null)
370 if (!is_array($addresses) && isset($name)) {
371 $addresses = array($addresses => $name);
375 $this->
getHeaders()->addMailboxHeader(
'Cc', (array) $addresses);
401 public function addBcc($address, $name = null)
403 $current = $this->
getBcc();
404 $current[$address] = $name;
406 return $this->
setBcc($current);
420 public function setBcc($addresses, $name = null)
422 if (!is_array($addresses) && isset($name)) {
423 $addresses = array($addresses => $name);
427 $this->
getHeaders()->addMailboxHeader(
'Bcc', (array) $addresses);
454 $priorityMap = array(
461 $pMapKeys = array_keys($priorityMap);
462 if ($priority > max($pMapKeys)) {
463 $priority = max($pMapKeys);
464 }
elseif ($priority < min($pMapKeys)) {
465 $priority = min($pMapKeys);
468 sprintf(
'%d (%s)', $priority, $priorityMap[$priority]))) {
469 $this->
getHeaders()->addTextHeader(
'X-Priority',
470 sprintf(
'%d (%s)', $priority, $priorityMap[$priority]));
490 return isset($priority) ? $priority : 3;
504 ->addMailboxHeader(
'Disposition-Notification-To', $addresses);
543 $newChildren = array();
545 if ($entity !== $child) {
546 $newChildren[] = $child;
566 return 'cid:'.$entity->getId();
578 $string = parent::toString();
581 $string = parent::toString();
608 parent::toByteStream($is);
611 parent::toByteStream($is);
627 $part->setContentType($this->_userContentType);
628 $part->setBody($this->
getBody());
629 $part->setFormat($this->_userFormat);
630 $part->setDelSp($this->_userDelSp);
641 $childLevel = $child->getNestingLevel();
642 if ($highestLevel < $childLevel) {
643 $highestLevel = $childLevel;
647 return $highestLevel;