First Version Custom Content Types

This commit is contained in:
SirLouen 2025-06-26 17:41:53 +02:00
parent 0ff2d3c8ea
commit f744202d2c
1 changed files with 15 additions and 0 deletions

View File

@ -2852,6 +2852,8 @@ class PHPMailer
$result .= $this->headerLine('Content-Type', static::CONTENT_TYPE_MULTIPART_ALTERNATIVE . ';');
$result .= $this->textLine(' boundary="' . $this->boundary[1] . '"');
break;
case 'custom_content_type':
break;
default:
//Catches case 'plain': and case '':
$result .= $this->textLine('Content-Type: ' . $this->ContentType . '; charset=' . $this->CharSet);
@ -3278,6 +3280,9 @@ class PHPMailer
if ($this->attachmentExists()) {
$type[] = 'attach';
}
if ($this->contentTypeExists()) {
$type[] = 'custom_content_type';
}
$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
@ -4087,6 +4092,16 @@ class PHPMailer
return !empty($this->AltBody);
}
/**
* Check if the content type is set.
*
* @return bool
*/
public function contentTypeExists()
{
return !empty($this->ContentType);
}
/**
* Clear queued addresses of given kind.
*