protected function PHPMailer::setMessageType

5.x PHPMailer.php protected PHPMailer::setMessageType()

Set the message type. PHPMailer only supports some preset message types, not arbitrary MIME structures.

1 call to PHPMailer::setMessageType()
PHPMailer::preSend in inc/PHPMailer/src/PHPMailer.php
Prepare a message for sending.

File

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

Class

PHPMailer
PHPMailer - PHP email creation and transport class.

Namespace

PHPMailer\PHPMailer

Code

protected function setMessageType() 
 {
  $type = [];
  if ($this->alternativeExists()) {
    $type [] = 'alt';
  }
  if ($this->inlineImageExists()) {
    $type [] = 'inline';
  }
  if ($this->attachmentExists()) {
    $type [] = 'attach';
  }
  $this->message_type = implode('_', $type);
  if ('' == $this->message_type) {
    //The 'plain' message_type refers to the message having a single body element, not that it is plain-text
    $this->message_type = 'plain';
  }
}