51 'Content-Transfer-Encoding'
54 array(
'Date',
'Message-ID',
'From')
56 $this->
getHeaders()->addTextHeader(
'MIME-Version',
'1.0');
68 return self::LEVEL_TOP;
79 $this->
getHeaders()->addTextHeader(
'Subject', $subject);
101 $this->
getHeaders()->addDateHeader(
'Date', $date);
123 $this->
getHeaders()->addPathHeader(
'Return-Path', $address);
145 if (!is_array($address) && isset($name))
147 $address = array($address => $name);
152 $this->
getHeaders()->addMailboxHeader(
'Sender', (array) $address);
174 public function addFrom($address, $name = null)
177 $current[$address] = $name;
178 return $this->
setFrom($current);
192 public function setFrom($addresses, $name = null)
194 if (!is_array($addresses) && isset($name))
196 $addresses = array($addresses => $name);
201 $this->
getHeaders()->addMailboxHeader(
'From', (array) $addresses);
227 $current[$address] = $name;
244 if (!is_array($addresses) && isset($name))
246 $addresses = array($addresses => $name);
251 $this->
getHeaders()->addMailboxHeader(
'Reply-To', (array) $addresses);
274 public function addTo($address, $name = null)
276 $current = $this->
getTo();
277 $current[$address] = $name;
278 return $this->
setTo($current);
292 public function setTo($addresses, $name = null)
294 if (!is_array($addresses) && isset($name))
296 $addresses = array($addresses => $name);
301 $this->
getHeaders()->addMailboxHeader(
'To', (array) $addresses);
324 public function addCc($address, $name = null)
326 $current = $this->
getCc();
327 $current[$address] = $name;
328 return $this->
setCc($current);
340 public function setCc($addresses, $name = null)
342 if (!is_array($addresses) && isset($name))
344 $addresses = array($addresses => $name);
349 $this->
getHeaders()->addMailboxHeader(
'Cc', (array) $addresses);
372 public function addBcc($address, $name = null)
374 $current = $this->
getBcc();
375 $current[$address] = $name;
376 return $this->
setBcc($current);
388 public function setBcc($addresses, $name = null)
390 if (!is_array($addresses) && isset($name))
392 $addresses = array($addresses => $name);
397 $this->
getHeaders()->addMailboxHeader(
'Bcc', (array) $addresses);
419 $priorityMap = array(
426 $pMapKeys = array_keys($priorityMap);
427 if ($priority > max($pMapKeys))
429 $priority = max($pMapKeys);
431 elseif ($priority < min($pMapKeys))
433 $priority = min($pMapKeys);
436 sprintf(
'%d (%s)', $priority, $priorityMap[$priority])))
438 $this->
getHeaders()->addTextHeader(
'X-Priority',
439 sprintf(
'%d (%s)', $priority, $priorityMap[$priority]));
455 return isset($priority) ? $priority : 3;
467 ->addMailboxHeader(
'Disposition-Notification-To', $addresses);
497 $newChildren = array();
500 if ($entity !== $child)
502 $newChildren[] = $child;
518 return 'cid:' . $entity->
getId();
530 $string = parent::toString();
535 $string = parent::toString();
561 parent::toByteStream($is);
566 parent::toByteStream($is);
586 $part->setContentType($this->_userContentType);
587 $part->setBody($this->
getBody());
588 $part->setFormat($this->_userFormat);
589 $part->setDelSp($this->_userDelSp);
600 $childLevel = $child->getNestingLevel();
601 if ($highestLevel < $childLevel)
603 $highestLevel = $childLevel;
606 return $highestLevel;