protected function PHPMailer::getBoundary

5.x PHPMailer.php protected PHPMailer::getBoundary($boundary, $charSet, $contentType, $encoding)

Return the start of a message boundary.

Parameters

string $boundary:

string $charSet:

string $contentType:

string $encoding:

Return value

string

1 call to PHPMailer::getBoundary()
PHPMailer::createBody in inc/PHPMailer/src/PHPMailer.php
Assemble the message body. Returns an empty string on failure.

File

inc/PHPMailer/src/PHPMailer.php, line 2732

Class

PHPMailer
PHPMailer - PHP email creation and transport class.

Namespace

PHPMailer\PHPMailer

Code

protected function getBoundary($boundary, $charSet, $contentType, $encoding) 
 {
  $result = '';
  if ('' == $charSet) {
    $charSet = $this->CharSet;
  }
  if ('' == $contentType) {
    $contentType = $this->ContentType;
  }
  if ('' == $encoding) {
    $encoding = $this->Encoding;
  }
  $result .= $this->textLine('--' . $boundary);
  $result .= sprintf('Content-Type: %s; charset=%s', $contentType, $charSet);
  $result .= static::$LE;
  // RFC1341 part 5 says 7bit is assumed if not specified
  if (static::ENCODING_7BIT != $encoding) {
    $result .= $this->headerLine('Content-Transfer-Encoding', $encoding);
  }
  $result .= static::$LE;

  return $result;
}