Definition at line 40 of file Abstract.php.
◆ _buildBody()
Generate MIME compliant message from the current configuration
If both a text and HTML body are present, generates a multipart/alternative Zend_Mime_Part containing the headers and contents of each. Otherwise, uses whichever of the text or HTML parts present.
The content part is then prepended to the list of Zend_Mime_Parts for this message.
- Returns
- void
- See also
- Zend_Mail_Transport_Exception
Definition at line 233 of file Abstract.php.
235 if ((
$text = $this->_mail->getBodyText())
236 && ($html = $this->_mail->getBodyHtml()))
240 $boundaryLine = $mime->boundaryLine($this->EOL);
241 $boundaryEnd = $mime->mimeEnd($this->EOL);
243 $text->disposition =
false;
244 $html->disposition =
false;
246 $body = $boundaryLine
247 .
$text->getHeaders($this->EOL)
249 .
$text->getContent($this->EOL)
252 . $html->getHeaders($this->EOL)
254 . $html->getContent($this->EOL)
260 $mp->boundary = $mime->boundary();
262 $this->_isMultipart =
true;
265 array_unshift($this->_parts, $mp);
268 $this->_headers = $this->_mail->getHeaders();
273 if (
false !== (
$body = $this->_mail->getBodyHtml())) {
274 array_unshift($this->_parts,
$body);
275 }
elseif (
false !== (
$body = $this->_mail->getBodyText())) {
276 array_unshift($this->_parts,
$body);
283 #require_once 'Zend/Mail/Transport/Exception.php'; 288 $this->_headers = $this->_mail->getHeaders();
289 $headers =
$body->getHeadersArray($this->EOL);
290 foreach ($headers as
$header) {
elseif(isset( $params[ 'redirect_parent']))
const MULTIPART_ALTERNATIVE
◆ _formatHeader()
static _formatHeader |
( |
& |
$item, |
|
|
|
$key, |
|
|
|
$prefix |
|
) |
| |
|
staticprotected |
Prepend header name to header value
- Parameters
-
string | $item | |
string | $key | |
string | $prefix | @access protected |
- Returns
- void
Definition at line 165 of file Abstract.php.
◆ _getHeaders()
Return all mail headers as an array
If a boundary is given, a multipart header is generated with a Content-Type of either multipart/alternative or multipart/mixed depending on the mail parts present in the Zend_Mail object present.
- Parameters
-
- Returns
- array
Definition at line 127 of file Abstract.php.
131 $type = $this->_mail->getType();
133 if ($this->_mail->hasAttachments) {
135 }
elseif ($this->_mail->getBodyText() && $this->_mail->getBodyHtml()) {
142 $this->_headers[
'Content-Type'] = array(
150 $this->_headers[
'MIME-Version'] = array(
'1.0');
elseif(isset( $params[ 'redirect_parent']))
const MULTIPART_ALTERNATIVE
◆ _prepareHeaders()
_prepareHeaders |
( |
|
$headers | ) |
|
|
protected |
Prepare header string for use in transport
Prepares and generates $header based on the headers provided.
- Parameters
-
mixed | $headers | @access protected |
- Returns
- void
- Exceptions
-
- See also
- Zend_Mail_Transport_Exception
-
Zend_Mail_Transport_Exception
Definition at line 181 of file Abstract.php.
187 #require_once 'Zend/Mail/Transport/Exception.php'; 199 array_walk(
$content, array(get_class($this),
'_formatHeader'),
$header);
206 foreach (explode($this->EOL, $this->header) as $line) {
207 if (strlen(trim($line)) > 998) {
216 #require_once 'Zend/Mail/Transport/Exception.php';
◆ _sendMail()
Send an email independent from the used transport
The requisite information for the email will be found in the following properties:
◆ send()
Send a mail using this transport
- Parameters
-
- Returns
- void
- Exceptions
-
- See also
- Zend_Mail_Transport_Exception
Definition at line 305 of file Abstract.php.
307 $this->_isMultipart =
false;
308 $this->_mail = $mail;
316 $count = count($this->_parts);
322 #require_once 'Zend/Mail/Transport/Exception.php'; 328 $mime =
new Zend_Mime($this->_mail->getMimeBoundary());
330 }
elseif ($this->_isMultipart) {
345 $this->body =
$message->generateMessage($this->EOL);
elseif(isset( $params[ 'redirect_parent']))
_prepareHeaders($headers)
◆ $_headers
◆ $_isMultipart
◆ $_mail
◆ $_parts
◆ $body
◆ $boundary
◆ $EOL
◆ $header
◆ $recipients
The documentation for this class was generated from the following file:
- vendor/magento/zendframework1/library/Zend/Mail/Transport/Abstract.php