Returns rendered Mail Part of Body, containing Header Fields and Body Content.
@access		public
@return		string
195537
public function render()
	{
		return $this->headers->toString().Net_Mail::$delimiter.Net_Mail::$delimiter.$this->content/*.PHP_EOL*/;
	}
1041260
public function getHeaderText(): string
    {
        $header      = $this->getHeaderElement();
        $header_text = $header->getText();
        $header_link = $header->find('css', 'a');

        // The page headers can often include an 'add new link'. Strip that out of the header text.
        if ($header_link) {
            $header_text = trim(str_replace($header_link->getText(), '', $header_text));
        }

        return $header_text;
    }
122741
private function formatBody()
    {
        $body = [];

        if (!empty($this->files)) {
            $data = [];

            if(!is_null($this->serialized_payload)) {
                collect($this->serialized_payload)->each(function($value, $key) use (&$data) {
                    $data[] = [
                        'name'     => $key,
                        'contents' => $value,
                    ];
                });
            }

            $body['multipart'] = array_merge($this->files, $data);

            return $body;
        }

        if ($this->content_type == Mime::JSON) {
            $body['json'] = $this->serialized_payload;
        } elseif ($this->method == Http::GET) {
            $body['query'] = $this->serialized_payload;
        } elseif (is_array($this->serialized_payload)) {
            $body['form_params'] = $this->serialized_payload;
        } else {
            $body['body'] = $this->serialized_payload;
        }

        return $body;
    }
1220747
public function body() {
        $event = [];
        if (!empty($this->replyToken)) {
            $event['replyToken'] = $this->replyToken;
        }
        $event['type'] = $this->eventType();
        $event['timestamp'] = time();
        $event['source'] = $this->source;
        $event['message'] = $this->message;
        $result = ['events' => [$event]];
        return json_encode($result);
    }
434019
public function generateBody()
    {
        $data = $this->noMimeMessage . ezcMailTools::lineBreak();
        foreach ( $this->parts as $part )
        {
            $data .= ezcMailTools::lineBreak() . '--' . $this->boundary . ezcMailTools::lineBreak();
            $data .= $part->generate();
        }
        $data .= ezcMailTools::lineBreak() . '--' . $this->boundary . '--';
        return $data;
    }
1066209
public function extractResponseHeadersAndBody()
    {
        $headerSize = $this->getHeaderSize();

        $rawHeaders = mb_substr($this->rawResponse, 0, $headerSize);
        $rawBody = mb_substr($this->rawResponse, $headerSize);

        return [trim($rawHeaders), trim($rawBody)];
    }
1052365
public function getEmailContent() : string
    {
        $result = '';

        $module = Inflector::singularize($this->table->getAlias());
        $displayValue = $this->getDisplayValue();
        $user = $this->getUserString();
        $action = $this->entity->isNew() ? 'created' : 'updated';

        // Example: Lead Foobar created by System
        $result = sprintf("%s %s %s by %s", $module, $displayValue, $action, $user);

        $changeLog = $this->getChangelog();
        if (!empty($changeLog)) {
            $result .= "\n\n";
            $result .= $changeLog;
            $result .= "\n";
        }

        $result .= "\n\n";
        $result .= "See more: ";
        $result .= $this->getEntityUrl();

        return $result;
    }
203833
public function assembleAttachmentBody()
    {
        $body = array();
        $body[] = "This is a multi-part message in MIME format.";
        $body[] = "--{$this->_uid}";
        $body[] = "Content-Type: text/html; charset=\"utf-8\"";
        $body[] = "Content-Transfer-Encoding: quoted-printable";
        $body[] = "";
        $body[] = quoted_printable_encode($this->_message);
        $body[] = "";
        $body[] = "--{$this->_uid}";

        foreach ($this->_attachments as $attachment) {
            $body[] = $this->getAttachmentMimeTemplate($attachment);
        }

        return implode(PHP_EOL, $body) . '--';
    }
1185693
protected function getSectionTextHtml()
    {
        if ($this->_text_encoding == 'quoted-printable') {
            return EmailHelper::qpContentTransferEncode($this->_text_html)."\r\n";
        } elseif ($this->_text_encoding == 'base64') {
            // don't add CRLF if using base64 - spam filters don't
            // like this
            return EmailHelper::base64ContentTransferEncode($this->_text_html);
        }
        return $this->_text_html."\r\n";
    }
200066
public function get_content_plain() {
		return wc_get_template_html( $this->template_plain, [
			'order'         => $this->object,
			'email_heading' => $this->get_heading(),
			'sent_to_admin' => false,
			'plain_text'    => true,
			'email'			=> $this,
		] );
	}
928864
public function render() 
	{	
		$message = $this->message;
		
		reset( $this->to );
		
		// default view parameters for the message and the layout
		$params = array(
			'mail' => $this,
			'to_email' => key($this->to),
			'to_name' => $this->to[ key($this->to) ],
		);
		
		// if the message is a view
		if ( $message instanceof \CCView ) 
		{	
			$message->_data = $message->_data + $params;
			$message = $message->render();
		}
		
		// prepare the layout
		if ( $this->layout ) 
		{
			$this->layout->content = $message;
			$this->layout->_data = $this->layout->_data + $params;
			
			$message = $this->layout->render();
		}
		
		// return the renderd message
		return $message;
	}
1102524
public function generateBody()
    {
        $result = $this->addHeadersSection( $this->message ) . ezcMailTools::lineBreak();
        for ( $i = 0; $i < count( $this->recipients ); $i++ )
        {
            $result .= $this->addHeadersSection( $this->recipients[$i] ) . ezcMailTools::lineBreak();
        }
        return $result;
    }
1314850
public function getMailMIME()
    {
        $result = '';
        $ismultipart = true;
        switch ($this->message_type) {
            case 'inline':
                $result .= $this->headerLine('Content-Type', 'multipart/related;');
                $result .= $this->textLine("\tboundary=\"" . $this->boundary[1] . '"');
                break;
            case 'attach':
            case 'inline_attach':
            case 'alt_attach':
            case 'alt_inline_attach':
                $result .= $this->headerLine('Content-Type', 'multipart/mixed;');
                $result .= $this->textLine("\tboundary=\"" . $this->boundary[1] . '"');
                break;
            case 'alt':
            case 'alt_inline':
                $result .= $this->headerLine('Content-Type', 'multipart/alternative;');
                $result .= $this->textLine("\tboundary=\"" . $this->boundary[1] . '"');
                break;
            default:
                // Catches case 'plain': and case '':
                $result .= $this->textLine('Content-Type: ' . $this->ContentType . '; charset=' . $this->CharSet);
                $ismultipart = false;
                break;
        }
        // RFC1341 part 5 says 7bit is assumed if not specified
        if ($this->Encoding != '7bit') {
            // RFC 2045 section 6.4 says multipart MIME parts may only use 7bit, 8bit or binary CTE
            if ($ismultipart) {
                if ($this->Encoding == '8bit') {
                    $result .= $this->headerLine('Content-Transfer-Encoding', '8bit');
                }
                // The only remaining alternatives are quoted-printable and base64, which are both 7bit compatible
            } else {
                $result .= $this->headerLine('Content-Transfer-Encoding', $this->Encoding);
            }
        }

        if ($this->Mailer != 'mail') {
            $result .= $this->LE;
        }

        return $result;
    }
1211732
private function getEmailHtml()
    {
        return $this->app['twig']->render(
            'email/pingtest.twig',
            [
                'sitename' => $this->app['config']->get('general/sitename'),
                'user'     => $this->options['user']['displayname'],
                'ip'       => $this->options['ip'],
            ]
        );
    }
232492
public function getStructure()
    {
        return isset($this->_data[Horde_Imap_Client::FETCH_STRUCTURE])
            ? clone $this->_data[Horde_Imap_Client::FETCH_STRUCTURE]
            : new Horde_Mime_Part();
    }
324024
public function generateHeaders()
    {
        // set our headers first.
        if ( $this->from !== null )
        {
            $this->setHeader( "From", ezcMailTools::composeEmailAddress( $this->from ) );
        }

        if ( $this->to !== null )
        {
            $this->setHeader( "To", ezcMailTools::composeEmailAddresses( $this->to ) );
        }
        if ( count( $this->cc ) )
        {
            $this->setHeader( "Cc", ezcMailTools::composeEmailAddresses( $this->cc ) );
        }
        if ( count( $this->bcc ) && $this->options->stripBccHeader === false )
        {
            $this->setHeader( "Bcc", ezcMailTools::composeEmailAddresses( $this->bcc ) );
        }

        $this->setHeader( 'Subject', $this->subject, $this->subjectCharset );

        $this->setHeader( 'MIME-Version', '1.0' );
        $this->setHeader( 'User-Agent', 'eZ Components' );
        $this->setHeader( 'Date', date( 'r' ) );
        $idhost = $this->from != null && $this->from->email != '' ? $this->from->email : 'localhost';
        if ( is_null( $this->messageId ) )
        {
            $this->setHeader( 'Message-Id', '<' . ezcMailTools::generateMessageId( $idhost ) . '>' );
        }
        else
        {
            $this->setHeader( 'Message-Id', $this->messageID );
        }

        // if we have a body part, include the headers of the body
        if ( is_subclass_of( $this->body, "ezcMailPart" ) )
        {
            return parent::generateHeaders() . $this->body->generateHeaders();
        }
        return parent::generateHeaders();
    }
484142
public function renderBodyContent()
    {
        $htmlWithPossibleErroneousClosingTags = $this->domDocument->saveHTML($this->getBodyElement());
        $bodyNodeHtml = $this->removeSelfClosingTagsClosingTags($htmlWithPossibleErroneousClosingTags);

        return \str_replace(['<body>', '</body>'], '', $bodyNodeHtml);
    }