public function __construct($content_, Io_Charset $charset_) { parent::__construct($content_, md5($content_), Io_Mimetype::TEXT_PLAIN($charset_)); $this->encoding = Mail::CONTENT_ENCODING_QUOTED_PRINTABLE; }
public function __construct($content_, Io_Charset $charset_) { parent::__construct($content_, md5($content_), Io_Mimetype::TEXT_HTML($charset_)); $this->encoding = Mail_Part::CONTENT_ENCODING_BASE64; }
public function contentEncoded() { if (isset($this->encoded)) { return $this->content; } return parent::contentEncoded(); }
protected function compileHeaders() { $this->header('MIME-Version', $this->version); $this->header('Date', $this->date->format(self::DATE_RFC_2822)); $this->header('Subject', $this->subjectEncoded()); foreach (['to', 'cc', 'bcc', 'from', 'reply-To'] as $addressType) { if (!($addresses = $this->{str_replace('-', '', $addressType)}()) || false === is_array($addresses)) { continue; } $addressStrings = []; foreach ($addresses as $email => $name) { if (null === $name || 1 > mb_strlen($name)) { $addressStrings[] = $email; } else { $addressStrings[] = "\"{$name}\" <{$email}>"; } } $this->header(ucfirst($addressType), implode(', ', $addressStrings)); $this->header('Message-Id', $this->messageId()); parent::compileHeaders(); } }